I'll need to debug this in a premier support ticket. I'm not that familiar with your database structure to determine what might be wrong with your sql. I'd try copy and pasting the sql statement into phpMyAdmin and see if it gives you a better error you can use to find the problem.