MYSQL表的线性转换

来源:互联网 发布:mac怎么下载qq 编辑:程序博客网 时间:2024/06/07 10:14

  1:select * from exam_proclass



     2: SELECT d.frist_id,d.frist_name,d.second_id,d.second_name,c.id as third_code,c.`name` as third_name from exam_proclass c join (SELECT a.id as frist_id,a.`name` as frist_name,b.id as second_id,b.`name` as second_name from exam_proclass a join exam_proclass b on a.id = b.fatherid ) d on c.fatherid = d.second_id



0 0