sql语句
1.按字段是否空分组,mysql数据库
SELECT
SUM(t.PROJECT_UNIT_COUNT) AS PROJECT_UNIT_COUNT,
COUNT(*) AS PROJECT_COUNT
FROM QS_PROJECT t GROUP BY ISNULL(t.`xx`)
2.根据出生日期,更新年龄字段
UPDATE `tp_infocollect_regs_base` SET age = DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW()) - TO_DAYS(birthday)),'%Y')+1