多个表左联,要返回全部的结果,解决不能用where的问题
2018-07-06 10:09
344 查看
qb.leftJoin('info_student', 'grouping_class_student.studentId', 'info_student.id'); qb.leftJoin('grouping_class', 'grouping_class_student.classId', 'grouping_class.id'); qb.leftJoin('exam_score', 'grouping_class_student.studentId', 'exam_score.studentId'); qb.where('grouping_class_student.planId', groupingId); qb.where(function() { this.where(function() { this.where('exam_score.planId', '=', examId); }).orWhere(function() { this.whereNull('exam_score.planId'); }); });
多个表左联,要返回全部的结果,解决不能用where的问题
qb.where(function() { this.where(function() { this.where('exam_score.planId', '=', examId); }).orWhere(function() { this.whereNull('exam_score.planId'); }); });
这一部份是关键点
相关文章推荐
- 解决Android中Fragment调用startactivityforresult不能返回结果的问题
- 在表示层禁用浏览器缓存的方法,以解决应用开发不能即时刷新体现修改结果的问题
- 解决mysql排序字段的数据为中文时不能正常显示结果的问题
- java执行cmd命令,返回结果中文乱码问题解决
- 如何解决结果由block返回情况下的同步问题
- Android中launcherMode="singleTask"详解<解决home键返回不能出现原界面问题>
- [Spring MVC] @ResponseBody返回结果乱码问题的解决
- 解决Yii2邮件发送结果返回成功,但接收不到邮件的问题
- 解决mybatis使用char类型字段查询oracle数据库时结果返回null问题
- ganymed-ssh2执行命令返回结果乱码的问题解决
- 使用dwr同步调用导致无法获取js方法的返回结果问题的解决办法
- 关于Webview执行goBack不能返回的问题解决
- 文件上传 通过隐藏iframe的方式来实现ajax上传文件并返回处理结果 ie乱码问题解决
- 对于Volley中onResponse无法返回数据结果的问题解决方法
- 如何解决jmeter响应结果树中,返回数据显示不完整的问题?
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- 类型:NodeJs;问题:默认IE的编码为utf8;结果:IE不能自动选择UTF-8编码解决办法
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- Android 6.0 解决recyclerview 在 scrollview 中不能全部显示,高度不正常的问题
- c++解决 {ctor}构造函数不能有返回类型或者无故缺少“;”(在“using”的前面)的问题