I have one table in postgresql and my table contain one column of timestamp without timezone
i want to write one query which will check if same date inserted multiple times or not if same date present more than once query should return that date
like 12 Sep 2011,12 Sep 2011,12 Sep 2011,10 Sep 2011,
Here 12 Sep 2011 date is present more than once how to write query for that
SELECT my_date FROM my_table GROUP BY my_date HAVING COUNT(my_date) > 1
If you have timestamps, you should drop the 'time' part:
SELECT time_column::DATE FROM my_table GROUP BY time_column::DATE HAVING COUNT(*) > 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With