Home » SQL & PL/SQL » SQL & PL/SQL » is it possible to switch between tables in query ?
is it possible to switch between tables in query ? [message #302935] Wed, 27 February 2008 06:57 Go to next message
amdabd
Messages: 91
Registered: November 2007
Location: My Computer
Member
hi,
is it possible to switch between tables in query depending on the output of a third one

./fa/3946/0/

ex:
select * from table1
-- if condition exist then
select * from table2
-- else
select * from table3

thanks
  • Attachment: a12.jpg
    (Size: 72.99KB, Downloaded 358 times)

[Updated on: Wed, 27 February 2008 07:03]

Report message to a moderator

Re: is it possible to switch between tables in query ? [message #302955 is a reply to message #302935] Wed, 27 February 2008 07:27 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Can you add some clarity to this statement
Quote:
is it possible to switch between tables in query depending on the output of a third one


Regards

Raj
Re: is it possible to switch between tables in query ? [message #302957 is a reply to message #302935] Wed, 27 February 2008 07:29 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Create a union and use your where clause to let the correct side of the union return a row.
Re: is it possible to switch between tables in query ? [message #303057 is a reply to message #302935] Wed, 27 February 2008 18:08 Go to previous messageGo to next message
amdabd
Messages: 91
Registered: November 2007
Location: My Computer
Member
hi,

I need the output of my query to be as follows

./fa/3950/0/

thanks again
  • Attachment: b1.jpg
    (Size: 44.45KB, Downloaded 330 times)
Re: is it possible to switch between tables in query ? [message #303079 is a reply to message #302935] Wed, 27 February 2008 22:08 Go to previous messageGo to next message
mshrkshl
Messages: 247
Registered: September 2006
Location: New Delhi
Senior Member
May you define your conditions more clearly?

regards,
Re: is it possible to switch between tables in query ? [message #303096 is a reply to message #303057] Wed, 27 February 2008 23:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Frank gave you the answer.

Regards
Michel
Re: is it possible to switch between tables in query ? [message #303098 is a reply to message #302935] Wed, 27 February 2008 23:53 Go to previous message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

BUt I thing Frank already answered your query .
Try in that direction .

Thumbs Up
Rajuvan.

[Updated on: Wed, 27 February 2008 23:54]

Report message to a moderator

Previous Topic: REGEXP_LIKE - using field name as part of regular expression?
Next Topic: relational operator in decode
Goto Forum:
  


Current Time: Sat Dec 10 04:49:55 CST 2016

Total time taken to generate the page: 0.05065 seconds