Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Retrieving database record with the lowest value in field aaa?
How do I code a SQL SELECT statement so that always only this record is retrieved
which matches a certain criteria AND has the lowest ID (= value in key field aaa)?
It must me something like
SELECT * FROM .... WHERE somefield='somevalue' AND aaa=lowestkey(column(aaa))
As a result either zero or at most 1 record should be passed back.
George Received on Thu Jan 27 2005 - 12:50:22 CST
![]() |
![]() |