Reputation: 1376
If I were to run a sample query along the lines of:
SELECT songIDs FROM blah WHERE fileID IN($fileIDs)
Would MySQL always return songIDs in the order $fileIDs was passed in? I need to be able to have them matched up index for index
Upvotes: 0
Views: 35
Reputation: 108400
No. A SELECT statement is not guaranteed to return rows in any specific order, absent an ORDER BY
clause on the query.
(The one exception with MySQL is that a GROUP BY
implies an ORDER BY
on the same list of expressions in the GROUP BY
clause.)
Upvotes: 1
Reputation: 166396
Simple answer is NO.
The result will be return in any order the databaser engine sees fit, unless you specify an ORDER BY
Upvotes: 2