How to query by recent date and value in SQL?
- by wsb3383
I have a table with three columns: patient_id, obs_date, and weight_val. patient_id stores patient identification #, weight_val stores a weight value, and obs_date stores the date when the weight reading was taken. So, a patient can have many different weight readings at different dates.
How do you write a query for:
select all patients whose last weight reading is 120?