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