这样的事情应该为您工作:
delete
from
MyTable
where
item_id in
(
select
item_id
from
MyTable
group by
item_id
having
count(item_id) > 15
)
and
Date < @tDate
sql语句删除存在早于XXX的记录(只要有YY行以上)
这样的事情应该为您工作:
delete
from
MyTable
where
item_id in
(
select
item_id
from
MyTable
group by
item_id
having
count(item_id) > 15
)
and
Date < @tDate