Sort by order of values in a select statement "in" clause in mysql -


I am selecting a group of account records from a large table (millions of rows) with integer ID values. In the original form of a question, as in one form, what I am doing to create a separate list from a big comma and I am passing in the query as the "in" section. The result is completely anonymous. What I want to do, results back in the order of values ​​in the "back" section.

I think instead I would have to create a temporary table and include one instead, which I would like to save but can not be able to.

Thoughts? The question size has been captured at just about 60 kilograms, because we are trying to limit the output size, but it can be arbitrarily larger, which can cancel the "in" question from any practical perspective. If not, thank you in advance.

In fact, this is better:

/ P>

 < Order (id, 5, 6, 8, 12, 1) by code> SELECT * your_ table WHERE id (5, 6, 8, 12, 1);  

Reason for FIELD documentation:


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -