If I have this table:
DROP TABLE IF EXISTS mytest;
CREATE TABLE mytest
(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
one INT,
used INT
);
INSERT INTO mytest SET one=20,used=6;
INSERT INTO mytest SET one=30,used=16;
INSERT INTO mytest SET one=35,used=3;
INSERT INTO mytest SET one=35,used=4;
INSERT INTO mytest SET one=40,used=2;
and I What to get all rows from the one field equal to 35 first and the rest of it order by ascendant, so I use this query:
SELECT * FROM mytest ORDER BY one=35 DESC,one ASC;
Now, I want order by most used too but taking account my previous order, so is right write something like this?:
SELECT * FROM mytest ORDER BY one=35 DESC,one ASC,used DESC;
I see it works but I just I'm guessing.