Need help with query with "where in" statment
I have a list of user ids that I need information from a table.
I've been using
SELECT * FROM users where users.id in (141,139,140)
I just want to know if there is a way to get MySQL to return the results in the order I give it in the set.
I need results in the form of 141 then 139 then 140
id | first_name | last_name
------------------------------------------------
141 |
139 |
140 |
instead of
id | first_name | last_name
------------------------------------------------
139 |
140 |
141 |
Any help will be much appreciated
Kenneth Yeung
Subject
Views
Written By
Posted
Need help with query with "where in" statment
2348
January 17, 2006 03:11AM
1566
January 17, 2006 04:46PM
1549
January 18, 2006 02:28AM
1501
January 18, 2006 03:29AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.