I have a table with columns: id and created(datetime)
id created 6 2011-11-04 20:32:09.673 5 2011-11-04 20:32:09.673 4 2011-11-04 20:29:55.000 3 2011-11-04 20:29:55.000
How to write sql, that will return counts of records that haven’t, have 2 or have more than 2 equal creation dates. It can be 3 separate sqls.
Thank you
If I understand your question correctly, I believe this should do the trick, returning any creation dates that occur more than once.
This one will get those with more than 2.
Swap the > 2 for an = 2 to get those with 2 exactly and =1 to get those with only 1 occurrence.