Hi Adam, all,

Adam Wolff wrote:
You could you use UNION to make this all execute in a single query.

Sure you can use UNION to get the data or the (separate) counts from the four tables, but a plain UNION can not sum over these individual parts.

I have not checked whether you can have a UNION in a subquery, this would be your only chance to do the OP's task in a single SQL statement. But IMO, it is better structure to do four separate SELECTs on the individual tables than to force it all into one.

Regards,
Jörg

--
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to