[EMAIL PROTECTED] wrote:
> The following query fails with error:
>
> [The Query]
>
> update call set call.assign_to = 'wxyx' where (select
> a.*,b.territory_code
> from call a inner join company b on a.company_id = b.company_id where
> (a.assign_to = 'abcd' and a.status = 'PENDING' and
> (b.territory_code = '520'
> or b.territory_code = '620')))
>
> [The Error]
>
> Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
> General error;-5016 POS(21) Missing delimiter: =.
> update call set call.assign_to = 'wxyx' where (select
> a.*,b.territory_code
> from call a inner join company b on a.company_id = b.company_id where
> (a.assign_to = 'abcd' and a.status = 'PENDING' and
> (b.territory_code = '520'
> or b.territory_code = '620')))
>
> Shouldn't this work?
I'm not sure if this is what you want but it should work:
update call
set assign_to = 'wxyx'
where assign_to = 'abcd' and
status = 'PENDING' and
exists (select 1
from company b
where call.company_id = company.company_id and
company.territory_code in ('520','620'))
Kind regards,
Holger
SAP Labs Berlin
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]