我有这样的查询:
SELECT a.id
FROM Tabel a
INNER JOIN (
SELECT MAX(id) AS id
FROM Tabel AS alt
WHERE alt.first = 1
OR alt.second = 1
GROUP BY least(second , first), greatest(second , first)
)b ON a.id = b.id
我想将其转换为'createQueryBuilder'格式。
我真的不知道我该怎么做INNER JOIN () ON
。
有什么建议吗?
谢谢!