The below query results in the following error:
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'AccountId' in where clause is ambiguous
$select = $this->select()
->from(array('finance_account' => DB_TABLE_PREFIX . 'finance_account'), array(
'AccountId',
'ParentAccountId',
'AccountGroupId',
'AccountPath',
'AccountCode',
'AccountName',
'Description'
))
->joinLeft(array('ac' => DB_TABLE_PREFIX . 'customer'), 'finance_account.AccountId = ac.AccountId', array())
// using "array_unique()" to minimize db overhead
->where('AccountId IN (?)', array_unique($parentIds))
->setIntegrityCheck(false);
I don't have any other column to do the join. What am I supposed to do now?