我有一个像这样的查询:
SELECT * FROM table a, table b
WHERE a.col1=b.col1
AND a.col2= b.col2
AND a.col3= b.col3
AND a.col4 = b.col4
AND a.id <> b.id
在表中搜索重复项。我需要通过 Doctrine 1 进行查询,但出现错误。这是我的代码:
$q = Doctrine_Query::create()
->from('table a, table b')
->where('a.col1= b.col1')
->andWhere('a.col2= b.col2')
->andWhere('a.col3= b.col3')
->andWhere('a.col4= b.col4')
->andWhere('a.id <> b.id');
错误是:
"Table" with an alias of "b" in your query does not reference the parent component it is related to.
什么是正确的方法,我需要什么?