其他分享
首页 > 其他分享> > 1527 患某种疾病的患者

1527 患某种疾病的患者

作者:互联网

题目描述:
在这里插入图片描述

写一条 SQL 语句,查询患有 I 类糖尿病的患者 ID (patient_id)、患者姓名(patient_name)以及其患有的所有疾病代码(conditions)。I 类糖尿病的代码总是包含前缀 DIAB1 。
按任意顺序返回结果表。
查询结果格式如下示例所示:
在这里插入图片描述

方法1:
主要思路:解题链接汇总

select *
from Patients
where conditions regexp '^DIAB1|\\sDIAB1'
select *
from Patients
where conditions like 'DIAB1%' or conditions like '% DIAB1%'

标签:patient,like,DIAB1,患者,1527,DIAB1%,conditions,select,某种
来源: https://blog.csdn.net/weixin_44171872/article/details/120102823