Comrades, I puzzle how to make a feint with my ears! =) I would be grateful for the help, or for the information that this will not work! MySQL

In general, such a request now

SELECT `id`, `first_name`, `last_name` FROM `users` where `group` = '1' 

What I want to get in the result, something like this

 SELECT `id`, `first_name`, `last_name` FROM `users` where `group` = '1' IF `id` = `какое то число`, то вывести его первым в списке потом все остальное. 

Honestly, fantasy is not enough, but I don’t have enough time to google the topic, I sew up with work ... I would be very grateful for the help.

Understand and forgive! =)

    1 answer 1

     SELECT `id`, `first_name`, `last_name` FROM `users` where `group` = '1' ORDER BY case when id=<какое-то число> then 0 else 1 end 
    • Thank you very much!!! Bail out! Works =) I have a request to you, if not difficult, briefly explain what case is and then 0 else 1 end. I want to know these moments for the future. Then (then) 0 else (otherwise) 1? it's not quite obvious how it works ... Thanks in advance and thanks again for the help! - Konstantin
    • Sort by the expression "if id = <some number> then 0 otherwise 1" - Zufir
    • In the general case, the case when x then y when x1 then y1 when x2 then y2 else z en construction is a result obtained in various conditions. What was the first to be executed - that result was obtained, if none of the conditions from when was fulfilled - then the result specified in else is returned. sql-tutorial.ru/ru/book_case_statement/page1.html - Zufir
    • one
      @ Konstantin case is a Bole less versatile tool compatible with many SQL. if the condition is satisfied then the value of then is returned otherwise from else. order by acc. puts at the beginning of the record with 0, then with 1. Specifically for MySQL, the same can be written shorter if(id=NNN,0,1) - Mike
    • @Mike Thank you so much! Explained intelligibly and clearly !!! Here with 0 and 1 kokraz it was not obvious, now I will know! These are the answers most intelligible and understandable! Thank!!! - Konstantin