vd
asked on
SELECT first record
I have a simple subquery in an Oracle SQLPLUS SELECT, but it returns > 1 records.
How do I select only the first or top record?
How do I select only the first or top record?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
select *
from my_table1
where id = (
select max(id)
from my_table2
);
or
select *
from my_table1
where id IN (
select id
from my_table2
);