List Distinct Diagnoses of One Patient
>_NixInfra
_
| HospitalDB
About
Contact
Databases
Postgres Engine
Database Schema
Question (#21)
Note
Display (
patient_id
,
diagnosis
) of the patient with ID
5
. List all of this patient's diagnoses without duplicates.
Expected Output
Query Editor
CLI Mode
Suggest: ON
Reset
Run Query
User Output
Ready
Execute a query or press Ctrl+Enter to view results...
Databases & Questions
Hint
Remove repeated values with DISTINCT, or by grouping.
Official Solutions
Select a solution...
Information
×
Query an Entire Table
Limit Rows From the Top of a Table
Return Rows From a Specific Position
Select Specific Columns and Assign a Default Value
Filter Rows With a Condition
Count All Rows Without a Condition
Count Rows With a Condition
Count Patients by Group Condition (Single Row)
Count Patients by Group Condition (Multiple Rows)
Concatenate Strings and Filter NULL Values
Concatenate Strings and Filter Non-NULL Values
Count Patients With and Without Allergies
Count Patients by Allergy Status and return multiple rows
Filter by Birth Year and Sort by Height
Filter by a List of IDs
Filter Patients With Odd IDs
Combine Conditions on Specialty and Last Name
Filter Names by Starting Letter
Find Maximum and Minimum Height and Weight
Find Patients With the Tallest and Shortest Height
List Distinct Diagnoses of One Patient
Aggregate Diagnoses Into a Single Row
Aggregate Distinct Diagnoses per Patient
Count Distinct Diagnoses per Patient
List Distinct Cities of a Province
Province Name With Its Cities
Find First Names That Appear Exactly Once
Filter Names by Length and Last Letter
Find Patients With a Specific Diagnosis
Find Repeat Admissions With the Same Diagnosis
Join Patients With Province Names
Count Patients per City
Count Patients per Province
Count Patients per City Within Each Province
Join Patients, Admissions and Doctor Specialty
Count Admissions per Doctor
Combine Patients and Doctors With a Role Column
Rank Allergies by Popularity
Format Doctor Names With UPPER and LOWER
Filter Aggregated Heights With HAVING
Weight Difference Within a Last-Name Group
Latest Admission of One Patient
Earliest and Latest Admission of One Patient
First and Last Day of Each Doctor
Join Admissions, Patients and Doctors
Calculate BMI
Find Duplicate Full Names
Combine Conditions on IDs With OR
Find Patients Without Admissions
Min, Max and Average Admissions per Day
Latest Admission per Patient With Doctor Name
Find the Latest Admission of Each Patient
Count Patients Born in a Given Year
Classify Patients by BMI Threshold
Filter Patients by Diagnosis and Doctor Name during a DATE range
Generate Temporary Passwords
Compute Admission Fees by Insurance Status
Provinces With More Male Than Female Patients
Daily Admissions and Change From Previous Day
Custom Sort With One Value First
Admissions per Doctor per Year
Find Pairs of Duplicate Patients
Doctors Above the Overall Average
Doctors Above the Average of Their Specialty
Find Patients Missing Both Height and Weight
Average Length of Stay per Diagnosis
Patient With the Most Admissions
Rank Doctors Within Each Specialty
Days Between Consecutive Admissions
Find Doctors Without Admissions
Find Duplicate Patients (NULL-Safe, is not distinct)
Doctor and Patient in Different Provinces
Different Provinces Including NULLs
Longest Stay per Patient
Calculate Current Age
Rank Doctors by Distinct Patients
Running Total of Admissions