学生表 students 里有字段(id,name,sex,city)
城市表 type2   里有字段 (id,city,type1_id)
请教怎么样 按照 type1_id 城市序号 降序列出 students 里的 信息 谢谢了

解决方案 »

  1.   

    SELECT s.*
    FROM students AS s
     JOIN type2 AS c
    ON s.city=c.city
    ORDER BY c.type1_id DESC
      

  2.   

    select *
    from  type2 as t
    inner join students as s on s.city = t.city
    by t.city desc
      

  3.   

    select s.*
    from students s join  type2 t
    on s.city = t.city
    order by t.type1_id descAs uper
      

  4.   


    select a.* from students a join type2 b on a.city=b.city order by b.type1_id desc