Identify potential readmissions by finding patients who had two visits within 30 days of each other. Return the patient's first name, last name, the first visit date, the second visit date, and the number of days between them. Each pair should appear only once. Sort by days_between ascending.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
date_of_birthTEXT
genderTEXT
emailTEXT
phoneTEXTNULL
blood_typeTEXT
cityTEXT
stateTEXT
🔗insurance_idINTNULL
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute