mysql date类型字段查询和插入格式
插入
INSERT INTO shengqi(id,content,mm) VALUES ('1','升 7:36<br/>降 16:59','2012-01-1');
查询:
select id,content from shengqi where DATE_FORMAT(mm,'%Y-%m') = '2012-01';
或
select id,content from shengqi where mm= '2012-01-01';
插入
INSERT INTO shengqi(id,content,mm) VALUES ('1','升 7:36<br/>降 16:59','2012-01-1');
查询:
select id,content from shengqi where DATE_FORMAT(mm,'%Y-%m') = '2012-01';
或
select id,content from shengqi where mm= '2012-01-01';