How to query by recent date and value in SQL?
        Posted  
        
            by wsb3383
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by wsb3383
        
        
        
        Published on 2010-05-16T23:09:42Z
        Indexed on 
            2010/05/16
            23:10 UTC
        
        
        Read the original article
        Hit count: 191
        
sql
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?
© Stack Overflow or respective owner