当前位置:网站首页>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%';
边栏推荐
- select 标签自定义样式
- Regular expression to match a certain string in the middle
- 继承关系下构造方法的访问特点
- DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
- 常见的硬件延迟
- 如何模拟后台API调用场景,很细!
- Error: Not a signal or slot declaration
- [深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
- sql语句多字段多个值如何进行排序
- 采用redis缓存的linux主从同步服务器图片硬盘满了移到新目录要修改哪些指向
猜你喜欢

The 2022 EdgeX China Challenge will be grandly opened on August 3

使用SuperMap iDesktopX数据迁移工具迁移地图文档和符号

【 2 】 OpenCV image processing: basic knowledge of OpenCV

Matlab map with color representation module value size arrow

海量服务实例动态化管理

【genius_platform软件平台开发】第七十六讲:vs预处理器定义的牛逼写法!!!!(其他组牛逼conding人员告知这么配置来取消宏定义)

The design idea of DMicro, the Go microservice development framework

虚拟内存原理与技术

Tree search (bintree)

DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
随机推荐
Jincang database KingbaseES V8 GIS data migration solution (3. Data migration based on ArcGIS platform to KES)
浅谈数据安全治理与隐私计算
[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
注意潍坊开具发票一般需要注意
The 2022 EdgeX China Challenge will be grandly opened on August 3
C语言日记 9 if的3种语句
特殊矩阵的压缩存储
在这个超连接的世界里,你的数据安全吗
【OpenCV 图像处理2】:OpenCV 基础知识
std::string::find 返回值的坑
基于左序遍历的数据存储实践
Hypervisor related knowledge points
[ROS] (10) ROS Communication - Service Communication
DAY23:命令执行&代码执行漏洞
js中try...catch和finally的用法
Common hardware delays
Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit
RAID disk array
常见的硬件延迟
多线程(2)