当前位置:网站首页>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%';
边栏推荐
- 浅谈数据安全治理与隐私计算
- Greenplum Database Fault Analysis - Why Does gpstart -a Return Failure After Version Upgrade?
- 采用redis缓存的linux主从同步服务器图片硬盘满了移到新目录要修改哪些指向
- 转:查尔斯·汉迪:你是谁,比你做什么更重要
- 数据增强Mixup原理与代码解读
- DAY22:sqli-labs 靶场通关wp(Less01~~Less20)
- 力扣-相同的树
- Programmer's list of sheep counting when insomnia | Daily anecdote
- 云原生(三十二) | Kubernetes篇之平台存储系统介绍
- 【C语言】详解栈和队列(定义、销毁、数据的操作)
猜你喜欢

iNFTnews | What can NFTs bring to the sports industry and fans?
![[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)](/img/7b/8b3f1e4f0000aa34fc1f8fff485765.png)
[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)

Advanced Numbers_Review_Chapter 1: Functions, Limits, Continuity

HOG feature study notes

QT语言文件制作

Common hardware delays

leetcode 15

甘特图来啦,项目管理神器,模板直接用

RAID disk array

海量服务实例动态化管理
随机推荐
C student management system Find student nodes based on student ID
Fragment visibility judgment
C语言日记 9 if的3种语句
Amazon Cloud Technology joins hands with Thundersoft to build an AIoT platform for industry customers
1667. 修复表中的名字
后期学习计划
C学生管理系统 头添加学生节点
Semi-Decentralized Federated Learning for Cooperative D2D Local Model Aggregation
js中try...catch和finally的用法
浅谈数据安全治理与隐私计算
VSCode Change Default Terminal 如何修改vscode的默认terminal
协作D2D局部模型聚合的半分散联合学习
继承关系下构造方法的访问特点
HDU 1114:Piggy-Bank ← 完全背包问题
Regular expression to match a certain string in the middle
ARM Mailbox
1484. 按日期分组销售产品
DAY23: Command Execution & Code Execution Vulnerability
C学生管理系统 指定位置插入学生节点
The 2022 EdgeX China Challenge will be grandly opened on August 3