Get records with max value for each group of grouped SQL results
17 answers

SQL: Group by minimum value in one field while selecting distinct rows
7 answers

I am having trouble in querying a table where I would like to have the minimum value of a column in a group. However, when I group the column together in order to clean the table, I get random values in the non group by columns.

I sort of understand why its doing that because I read this link https://www.psce.com/en/blog/2012/05/15/mysql-mistakes-do-you-use-group-by-correctly/. But even with his solution I am still a bit confused.

I queried for the min date and grouped by LastName so that I would get the youngest member of each family but the weight column returned is random, picking a random weight from any family member. Is there any way to fix this?

I have a page to increase the tracking on Facebook, I created a table to display the latest results in the id column, but this table shows the oldest results for the highest resultsPlease help me edit the table to show the latest results