Forum Discussion
ArarA911
Feb 13, 2023Copper Contributor
help in script
i have a table named table1 where it shows date, employee#, transaction# 1/1/2022 5656 123 2/1/2022 6565 321 and i would ...
olafhelper
Feb 13, 2023Bronze Contributor
ArarA911 , That's really less on information.
Next time, please post table design as DDL, some sample data as DML statement and the expected result.
This should work for you, a simple aggregation with a filter on the count:
SELECT date, employee, count(*) as cnt
FROM table1
GROUP BY date, employee
HAVING COUNT(*) = 2