根据身份证判断男女的规则:二代身份证为18位,判断倒数第二位,第二位若为奇数,性别为男:偶数则为女 一代身份证为15为,判断倒数第一位,规则同上. update 表名 set 表名.字段名= case when substring(表名,身份证字段,17,1)%2=1 and length(表名.身份证字段) =18 then "男" when substring(表名,身份证字段,17,1)%2=0 and length(表名.身份证字段) =18 then "女"
原表 sql语句: SELECT ) ' then '北京市' ' then '天津市' ' then '河北省' ' then '山西省' ' then '内蒙古自治区' ' then '辽宁省' ' then '吉林省' ' then '黑龙江省' ' then '上海市' ' then '江苏省' ' then '浙江省' ' then '安徽省' ' then '福建省' ' then '江西省' ' then '山东省' ' then '河南省' ' then '湖北省' ' then
#include "bin/libkci.h" static void exit_nicely(KCIConnection *conn) { KCIConnectionDestory(conn); exit(1); } int main() { KCIConnection *conn; KCIResult *res; int nFields; int i, j; conninfo = "host = localhost port = 54321 dbname = TEST u