select
*
from
test_county_sex
;
select county as county,
max(case when sex=1 then prou end )as man
,max(case when sex=2 then prou end )as woman
from test_county_sex group by county ;
select
county as county,
,max(decode(sex,'1',prou)) as man
,max(decode(sex,'2',prou)) as woman
from test_county_sex;
select * from sjqy.test_county
select * from test_county group by county,city,prou having count(*)>1;
select * from (
select
county,
city,
prou,
ROW_NUMBER() OVER (PARTITION BY county ORDER BY county ,prou DESC) RN
FROM test_county ) t
where t.rn=1;