请帮帮我。
我有原始SQL
WITH collections AS (
SELECT
...
FROM
...
)
SELECT
...
FROM collections c1
LEFT JOIN collections c2
...
如何使用Laravel QueryBuilder编写它?
答案 0 :(得分:1)
您可以使用Laravel查询生成器(https://laravel.com/docs/5.3/queries#raw-expressions)的RAW方法。只是谨慎对待潜在的SQL注入漏洞。