sql查询到带有联合的laravel查询
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql查询到带有联合的laravel查询相关的知识,希望对你有一定的参考价值。
我想将下面的联合查询转换为laravel查询
DB::select("select lead_master.lead_stage from lead_master inner join user_master on
user_master.user_name=lead_master.assigned_user_name where region in (".$geo_string.") and teams
in (".$filter_teams_string.") group by (lead_stage) union
select meeting_hash from meetings_master where assigned_user_name in
(".$filter_username_string.") and meeting_hash in ('follow_up','first_time') group by
(meeting_hash)
union
select sales_stage from opportunity_master where sales_stage in ('Identified','QO_to be
approved') and assigned_user in (".$filter_username_string.") group by (sales_stage)");
以下查询在postgre中效果很好
答案
None以上是关于sql查询到带有联合的laravel查询的主要内容,如果未能解决你的问题,请参考以下文章
从原始 SQL 到 Laravel Eloquent 或查询构建器