需要使用IN子句从表中删除数据,但IN子句中的记录超过1000. Query具有Group by和Having,并且表中的列太多了!所以我不确定如何使用TEMP表来做到这一点。
查询是:
DELETE * FROM test WHERE order_num IN(
select order_num
FROM test
WHERE TO_DATE (mod_dt) BETWEEN TO_DATE ('11-JUN-15') AND TO_DATE ('17-JUL-15')
AND REGION = 'AK'
GROUP BY order_num
HAVING COUNT(order_Num) > 1) ;
答案 0 :(得分:0)
我认为你不需要分组和有条款,对吗?
您可以使用公用表表达式:
sudo bash script.sh