This question shows research effort; it is useful and clear
-1
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
在此处查看所需的结果
到目前为止,我所拥有的是基于以下查询的结果
...这不是很接近我需要的
SELECT
P.NAME_LAST,
COUNT(P.NAME_LAST),
P_SEX_DISP = UAR_GET_CODE_DISPLAY(P.SEX_CD),
COUNT(P.SEX_CD)
FROM
PERSON P
GROUP BY
P.NAME_LAST
ORDER BY P.NAME_LAST ASC
select name_last,
sum(sex_cd = 'male'),
sum(sex_cd = 'female'),
sum(sex_cd not in ('male','female')),
count(*)
from person
group by name_last
order by name_last asc