mysql多字段组合删除重复行
程序员文章站
2022-05-25 20:49:09
DELETEFROM boll_paramWHERE id in ( SELECT a.id FROM ( SELECT id FROM boll_param WHERE (symbol, time_frame, ma, k, std, N, 回测起始日期, 回测结束日期, 交易方向) IN ( S ......
delete
from boll_param
where id in (
select a.id
from (
select id
from boll_param
where (symbol, time_frame, ma, k, std, n, 回测起始日期, 回测结束日期, 交易方向) in (
select symbol,
time_frame,
ma,
k,
std,
n,
回测起始日期,
回测结束日期,
交易方向
from boll_param
group by symbol, time_frame, ma, k, std, n, 回测起始日期, 回测结束日期, 交易方向
having count(*) > 1
)
and id not in (
select minid
from (
select min(id) as minid
from boll_param
group by symbol, time_frame, ma, k, std, n, 回测起始日期, 回测结束日期, 交易方向
having count(*) > 1
) dt
)) a
)
上一篇: setTimeout第三个参数
下一篇: 如何在PHP中进行身份认证