请问一下这个SQL语句的错误怎么解决呢?

浏览:283 发布日期:2018/01/26 分类:求助交流
$list = M()->query('
            select a.id,a.uid,a.type,a.num,a.people_num,a.theme,a.teacher,a.date,a.end_date,a.ctime,a.status,a.student1 as student1_id,
            (select t.theme from `course_theme` as t where t.id= a.theme) as theme,
            (select u.name from `user` as u where u.id= a.student1) as student1,
            (select u.tel  from `user` as u where u.id= a.student1) as tel1,
            (select u.img  from `user` as u where u.id= a.student1) as sfz_url_1,
            (select s.status  from `baoming_status` as s where s.user_id= a.student1 and s.theme_id= a.theme) as student1_status
            from `course_submission` as a   order by date desc limit '.$Page->firstRow.','.$Page->listRows);
        //echo $message->getLastSql();
        //dump($list);
1242:Subquery returns more than 1 row [ SQL语句 ] : select a.id,a.uid,a.type,a.num,a.people_num,a.theme,a.teacher,a.date,a.end_date,a.ctime,a.status,a.student1 as student1_id, (select t.theme from `course_theme` as t where t.id= a.theme) as theme, (select u.name from `user` as u where u.id= a.student1) as student1, (select u.tel from `user` as u where u.id= a.student1) as tel1, (select u.img from `user` as u where u.id= a.student1) as sfz_url_1, (select s.status from `baoming_status` as s where s.user_id= a.student1 and s.theme_id= a.theme) as student1_status from `course_submission` as a order by date desc limit 0,10
错误位置
FILE: D:\phpStudy\WWW\baoming\ThinkPHP\Library\Think\Db\Driver.class.php  LINE: 350
最佳答案
评论( 相关
后面还有条评论,点击查看>>