[thelist] multiple rows in the MySQL with same value

Fred Jones fredthejonester at gmail.com
Thu Jul 31 06:12:35 CDT 2008


> So the more general question I have is - when you do a query for a value
> that is in a table more than once, does the query stop on the first one it
> finds, so I should ORDER BY transaction date DESC? Or can you not count on
> this?

You absolutely must use an ORDER BY clause. Nothing is else is
guaranteed to return results *every time* in the desired order.
Anyway, the standard and correct method is to use ORDER BY. You can
then use LIMIT 1 also to just get the first result. :)

HTH



More information about the thelist mailing list