select top 1 record from resultset (PL/SQL, oracle)
809036Jan 3 2013 — edited Jan 4 2013i would like to ask how can i select top 1 record from the selected resultset to and then output as list in pl/sql
it is because i always retrieve two or more record from the resultset. my sql like belows:
select id from customer where surname ='WONG';
it returns:
2
3
4
in fact the table contain id 1,2,3,4
i have tried select id from customer where surname='WONG' and rownum=1;
it always return id=1, how can i select top 1 from resultset , in this case, id=2