首页上一页 1 下一页尾页 1 条记录 1/1页
很纠结的SQL代码,能帮忙解释一下么!
发表在JavaWeb图书答疑
2012-05-01
是否精华
是
否
版块置顶:
是
否
String sql="SELECT * FROM tb_lesson WHERE ID in(SELECT distinct lessonID FROM " +
"(SELECT lessonId,taoTiID FROM tb_questions GROUP BY taoTiID,lessonID,type)" +
" as lessonTaoTi GROUP BY lessonId,taoTiID HAVING COUNT(taoTiID) >1) AND" +
" name not in (SELECT distinct whichLesson FROM tb_stuResult WHERE stuId='"+studentID+"')";
"(SELECT lessonId,taoTiID FROM tb_questions GROUP BY taoTiID,lessonID,type)" +
" as lessonTaoTi GROUP BY lessonId,taoTiID HAVING COUNT(taoTiID) >1) AND" +
" name not in (SELECT distinct whichLesson FROM tb_stuResult WHERE stuId='"+studentID+"')";