I need to count rows that contain a date value entry. The row is initialized to 0000-00-00 and gets populated with a date later in my app process based on an event
I want to count how many rows have a date entered in the date field — DATE2 by each group date.
ID DATE1 DATE2
001 2012-10-01 0000-00-00
002 2012-10-04 2012-09-15
003 2012-10-03 0000-00-00
004 2012-10-04 2012-09-26
005 2012-10-01 2012-09-27
006 2012-10-02 0000-00-00
007 2012-10-02 2012-09-19
So I need the result (based on this simple example) to be:
2012-10-01 = 1 row
2012-10-02 = 1 row
2012-10-04 = 2 rows
SQL Fiddle Example