SQL转义查询和计算查询(0与1转换为男女)








select count(*) from arv_basinfo a, res_perinfo b where arvtypeid = 'e38bf6bf7a144f7eaa8ee01dfcc7d679' and a.arvid = b.arvid and b.sex = '1' and (2021 - substr(objid,7,4)) >= 60






select a.objnam as 姓名,a.objid as 身份证号,case b.sex when '1' then '男' when '0' then '女' else '未知' end as 性别 from arv_basinfo a, res_perinfo b where substr(repoinfo, 4,1) = '5' and a.arvid = b.arvid


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM