I have a database table that contains three columns: var_name, var_value and timestamp. var_name and var_value are both integers and timestamp is a date/time field. There are many rows for each value of var_name containing a different var_value and the timestamp is when the row was written.
I need a single SQL query that will return me the latest var_value for each var_ref in the table but my SQL skills aren't good enough for the task! Can someone help?
Thanks
I need a single SQL query that will return me the latest var_value for each var_ref in the table but my SQL skills aren't good enough for the task! Can someone help?
Thanks