标签:
SQL: select * from table where id IN (3,6,9,1,2,5,8,7);
这样的情况取出来后,其实,id还是按1,2,3,4,5,6,7,8,9,排序的,但如果我们真要按IN里面的顺序排序怎么办?
sql: select * from table where id IN (3,6,9,1,2,5,8,7) order by field(id,3,6,9,1,2,5,8,7);
出来的顺序就是指定的顺序了
标签:
原文地址:http://www.cnblogs.com/zhuiluoyu/p/4701745.html