subquery help

Reply

Join Date: Dec 2008
Posts: 297
Reputation: firoz.raj is an unknown quantity at this point 
Solved Threads: 1
firoz.raj firoz.raj is offline Offline
Posting Whiz in Training

subquery help

 
0
  #1
Jun 30th, 2009
Can anyone tell me .what will return this subquery.any help would
be Greatly appreciated.kindly help me.it will return single row or
multiple row if single then how.kindly let me know some idea.

  1. SELECT * FROM sub WHERE job=(SELECT job FROM job)
Last edited by firoz.raj; Jun 30th, 2009 at 5:58 am.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 123
Reputation: cgyrob is on a distinguished road 
Solved Threads: 18
cgyrob's Avatar
cgyrob cgyrob is offline Offline
Junior Poster

Re: subquery help

 
0
  #2
Jun 30th, 2009
Not sure what you are asking. This statement will most likely return an error. (Multiple values returned when expecting single value)

To make it work you will either have to use an "in" instead of "=" for your sub query or use a where clause within your sub to limit the return values to one value.

  1. SELECT * FROM sub WHERE job IN (SELECT job FROM job)

or

  1. SELECT * FROM sub WHERE job = (SELECT job FROM job WHERE value = something )
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Oracle
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC