我有 3 个带列的表
A:
id
B:
id
a_id
C:
id
b.id
使用本机查询:
SELECT a.id, b.id, c.id
FROM A as a
LEFT JOIN B as b
INNER JOIN C as c ON b.id = c.b_id
ON a.id = b.a_id
我努力了
SELECT a.id, b.id, c.id
FROM App\HomeBundle\Entity\A as a
LEFT JOIN App\HomeBundle\Entity\B as b
INNER JOIN App\HomeBundle\Entity\C as c
ON c.id = c.bId
ON a.id = b.aId
我得到了错误:
Error: Expected Literal, got 'JOIN'
是否可以将我的本机查询转换为 DQL 或查询生成器?如果可能,它会是什么样子?