question

jjdrugan avatar image
jjdrugan asked

How to get a single result from a data set and only get a single result from the group by

I am selecting from multiple tables, and my where clause orders the resule by a date and COL_NAME. The resulting set contains values that are grouped. What I would like to do is get only the last value from each group, and I am not sure how to do that. My result is attached. Also, is a mockup of what I want the result to look like. Thank you, John![alt text][1] [1]: /storage/temp/3672-what-i-want-result.png
group-bygrouping
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Magnus Ahlkvist avatar image
Magnus Ahlkvist answered
SELECT MAX(date), resident_name, condition FROM someTable GROUP BY resident_name, condition Would that be it?
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.