I'm probably missing somthing that is staring me in the face, but....
insert into stats_copy (domainname,d,d2) select domainname, datetime, sum(hits) as thits from stats where datetime >= DATE_SUB(NOW(),INTERVAL 7 DAY) and domainname like 'test%' and server=2 group by datetime ON DUPLICATE KEY UPDATE d
2=d2+thits
I get an error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DUPLICATE KEY UPDATE d2=d2+thits' at line 1
The same query without the 'on duplicate key update' part that I used to initially populate the table works fine.
I'm running 4.1.7, and the on duplicate key update is supposed to have been supported since 4.1.
Anyone spot the why this fails?
Thanks.
insert into stats_copy (domainname,d,d2) select domainname, datetime, sum(hits) as thits from stats where datetime >= DATE_SUB(NOW(),INTERVAL 7 DAY) and domainname like 'test%' and server=2 group by datetime ON DUPLICATE KEY UPDATE d
2=d2+thits
I get an error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DUPLICATE KEY UPDATE d2=d2+thits' at line 1
The same query without the 'on duplicate key update' part that I used to initially populate the table works fine.
I'm running 4.1.7, and the on duplicate key update is supposed to have been supported since 4.1.
Anyone spot the why this fails?
Thanks.