I sort the rows on date. If I want to select every row that has a unique value in the last column, can I do this with sql?
So I would like to select the first row, second one, third one not, fourth one I do want to select, and so on.

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you want are not unique rows, but rather one per group. This can be done by taking the
MIN(pk_artikel_Id)andGROUP BY fk_artikel_bron. This method uses anINsubquery to get the firstpk_artikel_idand its associatedfk_artikel_bronfor each uniquefk_artikel_bronand then uses that to get the remaining columns in the outer query.Although MySQL would permit you to add the rest of the columns in the
SELECTlist initially, avoiding theINsubquery, that isn’t really portable to other RDBMS systems. This method is a little more generic.It can also be done with a
JOINagainst the subquery, which may or may not be faster. Hard to say without benchmarking it.