当前位置:网站首页>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%';
边栏推荐
- 【存储】曙光存储DS800-G35 ISCSI各映射LUN给服务器
- 线性表的查找
- 解决connect: The requested address is not valid in its context
- Jincang database KingbaseES V8 GIS data migration solution (3. Data migration based on ArcGIS platform to KES)
- "Dilili, wait for the lights, wait for the lights", the prompt sound for safe production in the factory
- Programmer's list of sheep counting when insomnia | Daily anecdote
- 重新审视分布式系统:永远不会有完美的一致性方案……
- SDC简介
- 力扣-二叉树的最大的深度
- STM32使用stm32cubemx LL库系列教程
猜你喜欢

Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit

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

树表的查找

The design idea of DMicro, the Go microservice development framework

nodeJs--封装路由

lua learning

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

Access Characteristics of Constructor under Inheritance Relationship

Unleashing the engine of technological innovation, Intel joins hands with ecological partners to promote the vigorous development of smart retail

【C语言】详解栈和队列(定义、销毁、数据的操作)
随机推荐
正则表达式,匹配中间的某一段字符串
Solve connect: The requested address is not valid in its context
后期学习计划
Tree search (bintree)
View handler stepping record
继承关系下构造方法的访问特点
使用SuperMap iDesktopX数据迁移工具迁移地图文档和符号
Common hardware delays
汉字转拼音
力扣-二叉树的最大的深度
Industry case | insurance companies of the world's top 500 construction standards can be used to drive the business analysis system
J9数字货币论:web3的创作者经济是什么?
剑指offer专项突击版第20天
LeetCode uses the minimum cost to climb the stairs----dp problem
mysql树状结构查询问题
js中try...catch和finally的用法
Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
【存储】曙光存储DS800-G35 ISCSI各映射LUN给服务器
云原生(三十二) | Kubernetes篇之平台存储系统介绍