mysql有个字段是DATETIME类型,要实现可以按月统计,该怎么写sql语句?select month(f1) from tt group by month(f1)or select DATE_FORMAT(f1,'%m') from tt group by DATE_FORMAT(f1,'%m') 比如数据库的为2008-01-15 12:10:00则DATE_FORMAT的参数格式分别得到的结果为:'%Y' 2008'%Y-%m' 2008-01'%Y-%c' 2008-1'%m' 01…
转自: http://codingstandards.iteye.com/blog/604541 MySQL中导出CSV格式数据的SQL语句样本如下: select * from test_info into outfile '/tmp/test.csv' fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\r\n'; MySQL中导入CSV格式数据的SQL…