当前位置:网站首页>1527. Patients suffering from a disease
1527. Patients suffering from a disease
2022-08-05 02:32:00 【just six z】
前言
患者信息表: Patients
+--------------+---------+
| Column Name | Type |
+--------------+---------+
| patient_id | int |
| patient_name | varchar |
| conditions | varchar |
+--------------+---------+
patient_id (患者 ID)是该表的主键.
'conditions' (疾病)包含 0 个或以上的疾病代码,以空格分隔.
这个表包含医院中患者的信息.
来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/patients-with-a-condition
著作权归领扣网络所有.商业转载请联系官方授权,非商业转载请注明出处.
写一条 SQL 语句,查询患有 I 类糖尿病的患者 ID (patient_id)、患者姓名(patient_name)以及其患有的所有疾病代码(conditions).I 类糖尿病的代码总是包含前缀 DIAB1 .
按 任意顺序 返回结果表.
查询结果格式如下示例所示.
示例1:
输入:
Patients表:
+------------+--------------+--------------+
| patient_id | patient_name | conditions |
+------------+--------------+--------------+
| 1 | Daniel | YFEV COUGH |
| 2 | Alice | |
| 3 | Bob | DIAB100 MYOP |
| 4 | George | ACNE DIAB100 |
| 5 | Alain | DIAB201 |
+------------+--------------+--------------+
输出:
+------------+--------------+--------------+
| patient_id | patient_name | conditions |
+------------+--------------+--------------+
| 3 | Bob | DIAB100 MYOP |
| 4 | George | ACNE DIAB100 |
+------------+--------------+--------------+
解释:Bob 和 George 都患有代码以 DIAB1 开头的疾病.
来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/patients-with-a-condition
著作权归领扣网络所有.商业转载请联系官方授权,非商业转载请注明出处.
like
select
patient_id,patient_name,conditions
from
Patients
where
// 因为conditions字段符合DIAB1there will be a space in front of the,所以使用 '% xxx%'
conditions like 'DIAB1%' or conditions like '% DIAB1%';
边栏推荐
猜你喜欢
DAY22: sqli-labs shooting range clearance wp (Less01~~Less20)
Pisanix v0.2.0 发布|新增动态读写分离支持
HOG feature study notes
"Dilili, wait for the lights, wait for the lights", the prompt sound for safe production in the factory
[ROS](10)ROS通信 —— 服务(Service)通信
云原生(三十二) | Kubernetes篇之平台存储系统介绍
LeetCode uses the minimum cost to climb the stairs----dp problem
Jincang database KingbaseES V8 GIS data migration solution (3. Data migration based on ArcGIS platform to KES)
Opening - Open a new .NET modern application development experience
RAID disk array
随机推荐
The 20th day of the special assault version of the sword offer
C language diary 9 3 kinds of statements of if
Short domain name bypass and xss related knowledge
".NET IoT from scratch" series
SDC简介
采用redis缓存的linux主从同步服务器图片硬盘满了移到新目录要修改哪些指向
C学生管理系统 头添加学生节点
协作D2D局部模型聚合的半分散联合学习
意识形态的机制
浅谈数据安全治理与隐私计算
云原生(三十二) | Kubernetes篇之平台存储系统介绍
627. 变更性别
leetcode-另一棵树的子树
线性表的查找
线上MySQL的自增id用尽怎么办?
Using OpenVINO to implement the flying paddle version of the PGNet inference program
Intel XDC 2022 Wonderful Review: Build an Open Ecosystem and Unleash the Potential of "Infrastructure"
Common hardware delays
QT语言文件制作
Pisanix v0.2.0 发布|新增动态读写分离支持