【发布时间】:2011-09-08 20:54:49
【问题描述】:
这个查询有问题。
update table1 as a
left join (
select count(*) as 'rec' from table2 group by isin having rec<100 )
table2 as h on a.isin=h.isin
set a.nohist='1'
我想计算每组的行数,询问他们的计数是否小于 100 并在表 1 中设置一个标志。
我总是出错:
1064 - 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 'as h on a.isin=h.isin set a.nohist='1'' at line 4
你能帮帮我吗?
谢谢br
【问题讨论】: