I've found 2 possible ways to fix the rogue query :
1) Find and change the bit of code that is doing this
2) Downgrade from MySQL 5 to MySQL 4. This option will work, however it could take a whole day of downtime to do so it's a last resort.
I'll see if I can get option 1 working first