m, but I can't seem to figure out how to get it from only
> one query.
>
> Thanks
>
> Original Message Follows
> From: robert_rowe <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: Multiple sums in one query
> Date: Wed, 7 Jan 2004 13:46:02
Are you wanting to do this in one query? You could put an order by on your second
query. The first row returned by it should be what you are after.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
I have a table 'table1' with fields, 'key' and 'number'
There is another table 'table2' with fields 'key1' and 'key2'
'table2.key1' corresponds to 'table1.key'.
Now, I need to find, in one query, the sum of all 'table1.number' fields for
a given 'table2.key2' AND the highest sum of 'table1.number'