id是主键,查询就会默认的按主键排序,可不可以去掉这个排序,就按照我的 4 3 1 排序出来
select * from article where id = 4 or id = 3 or id = 1

解决方案 »

  1.   

    select * from article order by find_in_set(id,'4,3,1')
    or
    select * from article order by if(id = 4,1,if(id = 3,2,if(id = 1,3,4)))
      

  2.   

    (select * from article where id = 4)
    unin
    (select * from article where id = 3)
    unin
    (select * from article where id = 1)
      

  3.   

    select * from article where id = 4 or id = 3 or id = 1 order by id desc
      

  4.   

    select * 
    from article 
    where id = 4 or id = 3 or id = 1
    order by find_in_set(id,'4,3,1')