Track the accumulation of abnormal lab results for each patient over time. For each lab result, show the patient's full name, test_name, tested_at, is_abnormal, and a running count of abnormal results for that patient up to and including this test. Sort by patient last name, then tested_at.
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