统计分析查找总人数、男、女的人数

统计分析查找总人数、男、女的人数_第1张图片

SELECT
	count( * ) AS count,
	sum( CASE WHEN MOD ( substr( remark, 17, 1 ), 2 ) = 0 THEN 1 ELSE 0 END ) AS women,
	sum( CASE WHEN MOD ( substr( remark, 17, 1 ), 2 ) = 1 THEN 1 ELSE 0 END ) AS man 
FROM
	t_user

 

你可能感兴趣的:(java)