I have rows with the same unixtime date with different times. How can I select rows that has less then 3 duplicate dates.
The example would pull march 4th & 5th and not march 3rd since it's more then 3.
Example without unixtime: march 3rd 2008 12:08pm march 3rd 2008 10:28am march 3rd 2008 09:02pm march 4th 2008 12:08pm march 4th 2008 10:28am march 5th 2008 09:02pm
Example without unixtime:
march 3rd 2008 12:08pm march 3rd 2008 10:28am march 3rd 2008 09:02pm
march 4th 2008 12:08pm march 4th 2008 10:28am
march 5th 2008 09:02pm
Try COUNT, HAVING AND GROUP BY...
How would I count based on the Month and date, excluding the time when it comes to unixtime?
SELECT COUNT(*) as _times, MIN(unixtime) AS _unixtime FROM xxx GROUP BY unixtime HAVING COUNT(*)>3
This sort of problem is why you want to use DATETIME and TIMESTAMP datatypes.
SELECT FROM table GROUP BY date_format(mytimestamp, '%Y%m%d') HAVING COUNT ()>2