Link to home
Start Free TrialLog in
Avatar of trevor1940
trevor1940

asked on

SQL: Find duplicate by date

Hi

I have a PostGreSQL/PostGIS database
Something like this

ID, Group_ code , point_number, date, geom
1, 1234, 1 , 2018-05-10, geom
2, 1234, 2 , 2018-05-10, geom
3, 1234, 3 , 2018-05-10, geom
4, 1234, 4 , 2018-05-10, geom
5, 1234, 5 , 2018-05-10, geom
6, 1235, 1 , 2017-05-10, geom
7, 1235, 2 , 2017-05-10, geom
8, 1235, 3 , 2017-05-10, geom
9, 1235, 4 , 2017-05-10, geom
10, 1234, 1 , 2017-05-10, geom  // WRONG

Open in new window


I can have multiple Group_ code  the same but the should have the same date

I need to find all rows where the same Group_ code has 2 or more dates
ASKER CERTIFIED SOLUTION
Avatar of Sujith
Sujith
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trevor1940
trevor1940

ASKER

Thanx your query worked

BTW actual date column called date_time
You are welcome