Readmissions Within 30 Days
Hard
Healthcare Queries
Return the patient_id of every patient who was admitted again within 30 days after a previous discharge (a later admit_date that is after the discharge date and at most 30 days after it). Return each patient once.
Table schema
Admissions(id INT PRIMARY KEY, patient_id INT, admit_date DATE, discharge_date DATE)Sample data
id | patient_id | admit_date | discharge_date
1 | 1 | 2026-01-01 | 2026-01-05
2 | 1 | 2026-01-20 | 2026-01-25
3 | 2 | 2026-02-01 | 2026-02-03
4 | 2 | 2026-04-01 | 2026-04-02
5 | 3 | 2026-03-01 | 2026-03-04
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.