Thanks, I've tried replacing the qq/ with parens , but I still get exactly the same error -- maybe because my version of MySQL doesn't support subselect? Running mysqladmin version gives this:
mysqladmin Ver 8.23 Distrib 3.23.48, for suse-linux on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software
+,
and you are welcome to modify and redistribute it under the GPL licens
+e
Server version 3.23.48-Max-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 21 hours 24 min 28 sec