当前位置:网站首页>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%';
边栏推荐
- 02 [Development Server Resource Module]
- std::string::find 返回值的坑
- OpenGL 工作原理
- 多线程(2)
- 2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
- The design idea of DMicro, the Go microservice development framework
- iNFTnews | What can NFTs bring to the sports industry and fans?
- lua学习
- The 2022 EdgeX China Challenge will be grandly opened on August 3
- C language diary 9 3 kinds of statements of if
猜你喜欢

编译预处理等细节

KingbaseES V8 GIS data migration solution (2. Introduction to the capabilities of Kingbase GIS)
![02 [Development Server Resource Module]](/img/60/f77ed0bb0e5654c9dcd70b73a5bee8.png)
02 [Development Server Resource Module]

DAY22: sqli-labs shooting range clearance wp (Less01~~Less20)

2022-08-04:输入:去重数组arr,里面的数只包含0~9。limit,一个数字。 返回:要求比limit小的情况下,能够用arr拼出来的最大数字。 来自字节。

Go 微服务开发框架 DMicro 的设计思路

Quickly learn chess from zero to one

Compressed storage of special matrices

【 2 】 OpenCV image processing: basic knowledge of OpenCV

01 【前言 基础使用 核心概念】
随机推荐
正则表达式,匹配中间的某一段字符串
KingbaseES V8 GIS data migration solution (2. Introduction to the capabilities of Kingbase GIS)
线性表的查找
Opening - Open a new .NET modern application development experience
Gantt chart is here, project management artifact, template is used directly
[In-depth study of 4G/5G/6G topic-51]: URLLC-16-"3GPP URLLC related protocols, specifications, and technical principles in-depth interpretation"-11-High reliability technology-2-Link adaptive enhancem
虚拟内存原理与技术
SuperMap支持的国产环境汇总
RAID磁盘阵列
C语言日记 9 if的3种语句
LeetCode uses the minimum cost to climb the stairs----dp problem
SDC简介
View handler stepping record
matlab绘制用颜色表示模值大小的箭头图
【存储】曙光存储DS800-G35 ISCSI各映射LUN给服务器
C学生管理系统 据学号查找学生节点
【C语言】详解栈和队列(定义、销毁、数据的操作)
Dotnet 6 Why does the network request not follow the change of the system network proxy and dynamically switch the proxy?
627. 变更性别
力扣-二叉树的最大的深度