I need to get the first row returned from a select query that looks like this:
SELECT DISTINCT parm1 FROM table1 WHERE parm1 > 10 ORDER BY parm1
Can someone please show me how to do this?
Alex
Printable View
I need to get the first row returned from a select query that looks like this:
SELECT DISTINCT parm1 FROM table1 WHERE parm1 > 10 ORDER BY parm1
Can someone please show me how to do this?
Alex
Quote:
Originally Posted by bort
Code:select * from (
SELECT DISTINCT parm1 FROM table1 WHERE parm1 > 10 ORDER BY parm1 )
where rownum < 2
SELECT min(parm1) FROM table1 WHERE parm1 > 10
would achieve (almost) the same result in this case.
Almost being, this would return null if there were no records, rather than a no rows returned/no_data_found
That's exactly what I ended up doing. Thanks for the replies!Quote:
Originally Posted by gamyers