多个表左联,要返回全部的结果,解决不能用where的问题
2024-09-16 12:12:47
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');
});
}); 这一部份是关键点
最新文章
- nginx服务器http重定向到https的正确写法
- [转]eclipse重新编译
- java中的权限修饰符的理解
- BZOJ 3884 欧拉定理 无穷幂取模
- Webform(Linq增删改查)
- Html5的一些引擎使用感触
- 又一个绝对棒的对话框插件fancybox v1.3.4
- 我要阻止做java开发的男朋友去创业型公司工作吗?
- (Unity)Unity自定义Debug日志文件,利用VS生成Dll文件并使用Dotfuscated进展混淆,避免被反编译
- 文件控制列表命令setfacl和getfacl的使用
- windows7下硬盘安装ubuntu14.04
- java异常练习2
- Bootstrap-风格的下拉按框:Bootstrap Select
- [UIKit学习]01.关于UIView,frame,bounds,center
- 大数据学习系列之四 ----- Hadoop+Hive环境搭建图文详解(单机)
- NPOI 2.0 教程
- 插件占坑,四大组件动态注册前奏(二) 系统Service的启动流程
- pytest进阶之conftest.py
- POJ 3140 Contestants Division 【树形DP】
- JavaScript防篡改对象