Date-Based Summaries
mysql>
mysql>
mysql> CREATE TABLE Master (
-> LahmanID char(10) NOT NULL default '',
-> Lastname char(25) default NULL,
-> Firstname char(25) default NULL,
-> Bats char(1) default NULL,
-> Throws char(1) default NULL,
-> BirthMonth int(11) default NULL,
-> BirthDay int(11) default NULL,
-> BirthYear int(11) default NULL,
-> Debut int(11) default NULL,
-> PRIMARY KEY (LahmanID)
-> ) TYPE=MyISAM;
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql>
mysql> SELECT birthmonth, birthday, COUNT(*)
-> FROM master
-> WHERE birthmonth IS NOT NULL AND birthday IS NOT NULL
-> GROUP BY birthmonth, birthday;
Empty set (0.00 sec)
mysql>
mysql> drop table master;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category