27,580
社区成员
发帖
与我相关
我的任务
分享
select f_period ,f_wh_no,f_ord_no,f_item_no,f_col_no,f_pas_qtyl from table1
group by f_period ,f_wh_no,f_ord_no,f_item_no,f_col_no,f_pas_qtyl having count(1)>1
---支除重复
SELECT DISTINCT f_period,f_wh_no,f_ord_no,f_item_no,f_col_no
FROM table1
---查询有重复的,每组只会出现一条,查询全部用row_number()
SELECT f_period,f_wh_no,f_ord_no,f_item_no,f_col_no
FROM table1
GROUP BY f_period,f_wh_no,f_ord_no,f_item_no,f_col_no
HAVING COUNT(1)>1
/*注意null值与'' 是不相等的*/