"next lowest" in querry?

Results 1 to 2 of 2

Thread: "next lowest" in querry?

  1. #1
    Join Date
    Dec 1969

    Default "next lowest" in querry?

    I need a way to retrieve records of ONLY the next lowest value (not simply &#060; )<BR>"... where X_coord = 10 and Y_coord *(is the next lowest from)* 12"<BR><BR>such that if the next lowest Y coord was 9 and there were three records with X coord 10 and Y_coord 9 the querry would return only those three records.<BR><BR>Thanks for any suggestions (I&#039m hoping there&#039s a SQL statement that fits)<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default SQL solution?

    Have you tried a sub-query?<BR><BR>Using your example:<BR>SELECT ... FROM MyTable<BR>WHERE x_coord = 10<BR>AND y_coord = (SELECT max(y_coord) FROM MyTable WHERE y_coord &#060; 12)<BR><BR>Hope this helps, Tim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts