ORA-00913: too many values [message #599210] |
Wed, 23 October 2013 00:53  |
 |
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Hi all,
Can any one please help me on this Query and when i ran this below query it shows an error: ORA-00913: too many values
select * from oe_order_lines_all
where header_id in(select * FROM oe_order_headers_all where order_number=4721)
Thank you
|
|
|
|
|
|
|
Re: ORA-00913: too many values [message #599216 is a reply to message #599214] |
Wed, 23 October 2013 01:15   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
mist598 wrote on Wed, 23 October 2013 11:34I think yes it gives
You think? Just validate the output.
Quote:and i think that the sub query returns header_id from the headers table to the outer query is this correct?
Yes the subquery returns all the values of header_id for order_number "4721", so it should work fine.
|
|
|
Re: ORA-00913: too many values [message #599217 is a reply to message #599214] |
Wed, 23 October 2013 01:16   |
 |
msol25
Messages: 396 Registered: June 2011
|
Senior Member |
|
|
hi mist,
Your subquery will pass header id from subquery to outer query and it will give you matching header_id results.It will work like
equijoin.
Please use like this for getting better performance:
select a.*
from oe_order_lines_all a,
oe_order_headers_all b
where b.order_id = 4721
and a.header_id = b.header_id
[Updated on: Wed, 23 October 2013 01:16] Report message to a moderator
|
|
|
|
|
|