当前位置:网站首页>laravel 子查询
laravel 子查询
2022-08-05 15:34:00 【jianchenn】
laravel 子查询使用
$sql = DB::table('project')
->select('project_id','subject_id','user_id');
$join = DB::table('subject_info as si')
->joinSub($sql,'p',function($query){
$query -> on("p.subject_id","=","si.subject_id");
})
->leftJoin('member as m','m.id','=','p.user_id')
->select('p.*','si.subject_name','m.username')
->get();
边栏推荐
- 如果有10个词,我想从中取3个词,然后把所有的10选3的可能统计记录下来,该怎么做?...
- Several pits of Ruoyi switching from mysql to postgresql
- How to calculate heritability and breeding value in a full-sib family
- To be a famous corporate scientist or to be a tenured professor, this is a question
- 刷题《剑指Offer》day08
- Translating Images into Maps 论文笔记
- 浅谈推荐系统中的样本拼接
- 首创期货开户是否可靠?资金安全吗?
- SVM 的推导
- PR视频剪辑教程--视频特效和转场
猜你喜欢
随机推荐
如何以单一程序同时连接多种数据库?
Study Notes 251—XMind Shortcuts Summary
Generate a .pkl file and read the content of the .pkl file
消失的遗传力的进一步剖分及应用
对抗 | 利用de4dot解密被混淆的.NET代码
实战|记一次某系统的渗透测试
腾讯将取消部分外包免费食堂福利;iPhone 14 Pro或取消远峰蓝,新增紫色;马斯克:我被推特骗了|极客头条
学习笔记238— 如何在word文档中快速输入各类根号【根号下没输入数字,也不会出现虚线框】
统计遗传学:第五章,多基因评分PGS
BEVDet:High-Performance Multi-Camera 3D Object Detection in Bird-Eye-View 论文笔记
Translating Images into Maps 论文笔记
[FlareOn5] Ultimate Minesweeper WP
生成.pkl文件,读取.pkl文件的内容
如何找回u盘里丢失的文件,u盘里的文件丢了怎么找回
当名企科学家,还是当终身教授,这是一个问题
垃圾回收机制
Study Notes 238—How to quickly enter various root signs in a word document [No numbers are entered under the root sign, and a dashed box will not appear]
High Numbers_Proof_Intermediate Value Theorem
数据思维总结:
To be a famous corporate scientist or to be a tenured professor, this is a question









