我有三张表 student和student_app表里放了学生关键信息和基本信息
student_virtual下的data_index放了要在页面上显示的字段名字,这些字段的值是student和student_app是字段select (select data_index from student_virtual where table_name ='student') from student left join student_app using(student_id);但是一直报错,mysql是不是不支持这样的子查询,应该怎么该sql语句才能满足我的需求

解决方案 »

  1.   

    错误信息是什么? 贴出来以供分析。
    MYSQL4之前的版本不支持子查询。
      

  2.   

    mysql版本是多少,mysql4之前的版本是不支持子查询的。
      

  3.   

    select data_index from student_virtual inner join student on student_virtual.student_id=student.id left join student_app on
    student_virtual.student_id=student_app.student_id
    where table_name ='student';这样试试。
      

  4.   


    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') from student left join student_app using(student_id)' at line 1
      

  5.   


    不行的 student_virtual下没有student_id字段,这个表里存的是另外两张表的字段名和其他表的字段名,这两张表用student标实,我试试能不能截图上来