次のようなクエリがあります。
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.
正しい方法は何ですか、何が必要ですか?