标签: php mysql
例如:
83^password_length/2
我想先显示id 1,2,3,4,5,6,7,8,9,10 ,然后显示id = 7。如何用php编写这段代码?请帮助我10,9,8,6,5,4,3,2,1
id 1,2,3,4,5,6,7,8,9,10
id = 7
10,9,8,6,5,4,3,2,1
答案 0 :(得分:1)
您可以按特定的case表达式订购:
case
SELECT * FROM mytable ORDER BY CASE id WHEN 7 THEN 0 ELSE 1 END ASC, id DESC