sql - (MySQL) OrderBy Field1=3, Field2 -


I want to order a table:

First field first 1 = 3 then field 2 By DESC

I know that I can not write the orderbay field 1 = 3, Field 2 DESC

How can I apply it ??

To do chlorophya:

Assume that I have a table of books, I want to list all the books in the table. Since 1990 books have the desire to be on the top, then the rest of the books according to the title.

Actually, you can write the statement that you had said using your explanation example:

  SELECT * books ORDER BY (year = 1990) DESC, name < / Code> 

"year = 1990" "1" will be for those people where the year is 1990, so they will go to the top.


Comments