如题所述
身份证倒数第二个数代表性别,奇数是男性,偶数是女性,假设你身份证那一列叫identification
select case when substring(identification,len(identification)-1,1) %2 =0 then '女' else '男' end from table
select case when substring(identification,len(identification)-1,1) %2 =0 then '女' else '男' end from table
温馨提示:答案为网友推荐,仅供参考