Retrieving database record with the lowest value in field aaa?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George Dainis

    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='some value' AND aaa=lowestkey(c olumn(aaa))

    As a result either zero or at most 1 record should be passed back.

    George

Working...