Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9656

Re: Select statement ORDER BY Clause

$
0
0

You are selecting one row and only have a condition for one field, so you can pretty much expect any random record pulled from the database that matches the condition. I vaguely recall there were some discussions on SCN about SELECT UP TO... vs. SELECT SINGLE and how one record is selected if the criteria is ambiguous, etc.

 

Don't remember the details but IMHO it might not be a good idea to rely on DB lottery when you are clearly after particular value. Why not use MAX, for example? ORDER BY merely sorts the results, according to the documentation (unless Horst rewrote it for 7.4 ), so why would it influence the selection? I might be confused though...


Viewing all articles
Browse latest Browse all 9656

Trending Articles