我有以下查询:
select acc.Username from accounts acc
left join accountevents ace on acc.accountid=ace.accountid
left join leads lds on lds.leadid=acc.leadid
where lds.DateEntered>'2011-01-01' and lds.DateEntered<'2011-02-01'
Group by acc.Username
Having count(ace.accounteventid)=0
我想让它成为一个删除语句:
delete username from accounts
left join accountevents ace on accounts.accountid=ace.accountid
left join leads lds on lds.leadid=accounts.leadid
where Leads.DateEntered>'2011-01-01' and lds.DateEntered<'2011-02-01'
Having count(accountevents.accounteventid)=0
我收到以下错误:关键字“Having”附近的语法不正确。
有什么建议么?