我遇到了此查詢的問題。mysql更新加入並計數
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
你可以幫幫我嗎?
THX BR