On 28 Feb 2011, at 10:07, Jon Jensen wrote:

> Oh yeah, I overlooked that part. The join makes it multi-table syntax, so you 
> can't do order by/limit. A quick workaround is to do a subselect:
> 
> DELETE 
> FROM ' . DB_CMS . '.executives_revisions exre
> WHERE exre_id IN
>       (SELECT exre.exre_id
>       FROM ' . DB_CMS . '.executives_revisions exre 
>               INNER JOIN ' . DB_CMS . '.executives exec 
>                       ON exre.exre_exec_id=exec.exec_id 
>       WHERE exre.exre_exec_id=' . $exec_id . ' 
>               AND exre.exre_id!=exec.exec_revision 
>       ORDER BY exre.exre_created DESC 
>       LIMIT 5,9999999999999');
> 
> I'm assuming exre's primary key is exre_id, if not adjust that query 
> appropriately. 

That still fails:

"This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'"


I'm trying to rewrite it using a derived table in a second join so that there 
is no ORDER or LIMIT.

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to