I'm stuck at this query I'm writing. I'm hoping someone will be able to help me.
I have 2 linked tables: subjects and visits with a relationship on subject_id:
Subject_id, name, birthdate
Visit_id, Subject_id, parameter1, parameter2
Now I need to query that will get a result set of all subjects with the parameter1 and parameter2 of the latest visit_id.
I could do it using a select all query for subjects and than querying the visits table for every subject, but I'm sure there is a way to do this in 1 query. Could anyone be so kind to offer me some free consulting? ;)