把这个sql语句转化为MySQL的sql语句(SELECT c."name", b."diagnose", substrb ( to_char( trunc( SYSDATE, 'yy' ), 'yyyymmdd' ), 0, 4 ) - substrb ( to_char( trunc( c."birthday", 'yy' ), 'yyyymmdd' ), 0, 4 ) "年龄", c."home_address" FROM "wjj_yy_yldsj_mzghxx" a, "wjj_yy_yldsj_mzgzrz" b, "wjj_yy_yldsj_grjbxxb" c WHERE a."org_reg_id" = b."register_id" AND a."reg_class" = 2 AND a."org_code" = b."org_code" AND a."personid" = c."personid";)
时间: 2023-07-19 11:56:47 浏览: 157
以下是将该SQL语句转化为MySQL的语句:
SELECT c.`name`, b.`diagnose`, SUBSTR(TO_CHAR(TRUNC(SYSDATE(), 'yy'), 'yyyymmdd'), 1, 4) - SUBSTR(TO_CHAR(TRUNC(c.`birthday`, 'yy'), 'yyyymmdd'), 1, 4) AS `年龄`, c.`home_address`
FROM `wjj_yy_yldsj_mzghxx` a, `wjj_yy_yldsj_mzgzrz` b, `wjj_yy_yldsj_grjbxxb` c
WHERE a.`org_reg_id` = b.`register_id`
AND a.`reg_class` = 2
AND a.`org_code` = b.`org_code`
AND a.`personid` = c.`personid`;
阅读全文