laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 28 forks source link

Query Builder INTERSECT #2510

Open djboris88 opened 3 years ago

djboris88 commented 3 years ago

Is there a reason Laravel Query Builder does not support INTERSECT operator? I'm currently developing a project where I have to build complex queries for a massive filtration system, and the idea is to break them apart into smaller query services that are easily tested, and then group them where needed. But for that, I need the INTERSECT operator.

Right now, I am using UNION, and then doing a str_replace('union', 'intersect', $query->toSql()) and using that string to create a new Query Builder instance.