By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

Update Monthly table with Daily max / min

P: n/a
I have 2 tables, they are daily and monthly tables.

I want to update the monthly table with the max and min value of the daily
table with the corresponding month.

I figure out the following sql but it doesn't work because the group by
function seems not supposed to be allowed.

update MONTHLY as m
SET
m.M_HIGH=max(d.D_HIGH),
m.M_LOW=min(d.D_LOW)
WHERE m.MONTH=(select MONTH from DAILY as d
GROUP BY d.MONTH);

How can I make it in 1 sql statement ?

Thanks
Jul 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.