Bring x record as first value Mysql

0

How can I bring the list of MySQL records and bring me in the first position x-id? That is, if I have a table with 5 records each with its id and I want to bring them all but in first position I bring the ID # 4 is it possible to do that?

At the moment I have it with two queries, first I bring the info of id # 4 and then the rest, omitting the # 4 of course, but the question arises if you can in a single consultation

    
asked by Andress Blend 30.11.2016 в 20:14
source

1 answer

0

Try this:

SELECT * FROM MI_TABLA ORDER BY ID=4 DESC

What the trick does is the ORDER BY ID=4

    
answered by 30.11.2016 / 20:22
source