If there are 3 records with different amounts as 500, 1000 and 1500 respectively, so for default query will be like amount order by DESC, 2nd condition is there is a button like "MOVE TO TOP", if 500 amount user click on button then that record move to top and next records should be display amount wise like 1500, 1000.
If click on "move to top" button then current date will stored in click_date column I am using just default amount DESC query,
move_top table
id name amount clickdate
----------------------------------------------------
1 test 500 2017-02-04 07:25:00
2 test2 1000 2017-02-02 11:18:42
3 test3 1500 2017-02-01 03:26:07
Query:
SELECT *
FROM `move_top`
ORDER BY clickdate DESC, amount DESC
but it's not working properly
ORDER BY x, y
, it means to order byx
, but if two rows have the samex
then you order them byy
.ORDER BY
has no effect. I don't understand what you're trying to do.