Let's suppose I have a table with 3 columns:
ID | GroupId | DateCreatedOn |
I want to select the datas grouped by GroupId so:
select GroupId from tableName group by GroupId;
But what if I want to execute another select on each group? let's suppose now that I want the last created row (DateCreatedOn) of each group?
Also, I would like to retrieve ALL the columns and not only the GroupId.
Im kind of lost because I only have GroupId available.
Please provide some explanation and not only the correct query.