当前位置:网站首页>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%';
边栏推荐
- 多线程(2)
- [ROS] (10) ROS Communication - Service Communication
- 【 2 】 OpenCV image processing: basic knowledge of OpenCV
- matlab绘制用颜色表示模值大小的箭头图
- leetcode-对称二叉树
- 学习笔记-----左偏树
- [深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
- Common hardware delays
- shell语句修改txt文件或者sh文件
- 如何看待自己的羞愧感
猜你喜欢

Common hardware delays
![[LeetCode Brush Questions] - Sum of Numbers topic (more topics to be added)](/img/ee/6b52072c841af99488dc0c1141c74c.png)
[LeetCode Brush Questions] - Sum of Numbers topic (more topics to be added)

LPQ(局部相位量化)学习笔记

OpenGL 工作原理

Programmer's list of sheep counting when insomnia | Daily anecdote

How do programmers without objects spend the Chinese Valentine's Day

Optimizing the feed flow encountered obstacles, who helped Baidu break the "memory wall"?

shell语句修改txt文件或者sh文件

Jincang database KingbaseES V8 GIS data migration solution (3. Data migration based on ArcGIS platform to KES)

Matlab画图3
随机推荐
View handler 踩坑记录
LeetCode使用最小花费爬楼梯----dp问题
注意潍坊开具发票一般需要注意
leetcode-对称二叉树
Error: Not a signal or slot declaration
Note that Weifang generally needs to pay attention to issuing invoices
Regular expression to match a certain string in the middle
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
Advanced Numbers_Review_Chapter 1: Functions, Limits, Continuity
C学生管理系统 指定位置插入学生节点
sql语句多字段多个值如何进行排序
回顾51单片机
Matlab map with color representation module value size arrow
SDC简介
std::string::find 返回值的坑
Solve connect: The requested address is not valid in its context
Tree search (bintree)
leetcode 15
【C语言】详解栈和队列(定义、销毁、数据的操作)
2022-08-04: Input: deduplicated array arr, the numbers in it only contain 0~9.limit, a number.Return: The maximum number that can be spelled out with arr if the requirement is smaller than limit.from