当前位置:网站首页>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%';
边栏推荐
- Access Characteristics of Constructor under Inheritance Relationship
- Greenplum Database Fault Analysis - Can a Soft Connection Be Made to the Database Base Folder?
- 【OpenCV 图像处理2】:OpenCV 基础知识
- View handler stepping record
- Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit
- Access Characteristics of Constructor under Inheritance Relationship
- How to simply implement the quantization and compression of the model based on the OpenVINO POT tool
- 意识形态的机制
- Go 微服务开发框架 DMicro 的设计思路
- C学生管理系统 头添加学生节点
猜你喜欢
Intel XDC 2022 Wonderful Review: Build an Open Ecosystem and Unleash the Potential of "Infrastructure"
Tree search (bintree)
剑指offer专项突击版第20天
shell语句修改txt文件或者sh文件
QT语言文件制作
Flink 1.15.1 集群搭建(StandaloneSession)
Regular expression to match a certain string in the middle
Using OpenVINO to implement the flying paddle version of the PGNet inference program
dmp(dump)转储文件
从零到一快速学会三子棋
随机推荐
shell语句修改txt文件或者sh文件
Semi-Decentralized Federated Learning for Cooperative D2D Local Model Aggregation
HDU 1114:Piggy-Bank ← 完全背包问题
回顾51单片机
sql语句多字段多个值如何进行排序
select tag custom style
Domain Driven Design - MDD
Regular expression to match a certain string in the middle
继承关系下构造方法的访问特点
LPQ (local phase quantization) study notes
云原生(三十二) | Kubernetes篇之平台存储系统介绍
Programmer's list of sheep counting when insomnia | Daily anecdote
【解密】OpenSea免费创造的NFT都没上链竟能出现在我的钱包里?
[Fortune-telling-60]: "The Soldier, the Tricky Way"-2-Interpretation of Sun Tzu's Art of War
学习笔记-----左偏树
shell statement to modify txt file or sh file
View handler stepping record
VSCode Change Default Terminal how to modify the Default Terminal VSCode
Amazon Cloud Technology joins hands with Thundersoft to build an AIoT platform for industry customers
Simple implementation of YOLOv7 pre-training model deployment based on OpenVINO toolkit