Sort by Mysql

1

Good day friends I have a doubt to the I do the following query

As a result I get this

Is there any way to bring the data in the order in which the query was made? That is first the data of Id 1, then those of 3, and finally those of 2? Something like this Thanks in advance.

    
asked by Venté 20.12.2017 в 07:19
source

1 answer

3

Try this query:

SELECT * FROM fotos WHERE Id IN (1,2,3) ORDER BY FIELD(Id,1,3,2);

You can opt for more detailed information see here

    
answered by 20.12.2017 / 07:59
source