Incase I want to check out the presence of two columns in a table how do I do that .
select (ordernum,date ) from table_name A where (order_num,date) in (Select (order_num,date) from table_name B.
Gives me an error
and
if I write
select (ordernum,date ) from table_name A where exists (Select (ordernum,date ) from table_name B) gives me all orders and treats order_num and date as seperate columsn .
Please help
regards
03-06-2001, 03:27 PM
skg
It looks like you have extra parenthesis in your subquery
try this instead
select (ordernum,date ) from table_name A where (order_num,date) in (Select order_num,date from table_name B)
03-06-2001, 03:46 PM
sltalagan
Return the foll. error.
select (ordernum,date ) from table_name A where exists
*
ERROR at line 1:
ORA-00907: missing right parenthesis
03-06-2001, 07:41 PM
puneet
Guys!!
I am sorry about the bracket but it is the logic that I am looking for . I want to find out the columns in a table A which are similar to two columns in table B .
Please refer to my SQL and disregard the bracket error
How do i do that
thanks
03-07-2001, 09:31 AM
Oracledba8
Try This, Hopefully shoule be fine,
Select c1, c2 From Table1 a
where exists (select c1, c2 from table2 b where a.c1=b.c1 and a.c2=b.c2)