SQL - Select unique rows from a group of results

前端 未结 5 1171
时光说笑
时光说笑 2021-01-25 14:44

I have wrecked my brain on this problem for quite some time. I\'ve also reviewed other questions but was unsuccessful.

The problem I have is, I have a list of results/t

5条回答
  •  忘掉有多难
    2021-01-25 15:36

    select registration,ID,date,unittype
    from your_table
    where (registration, date) IN (select registration,max(date)
                                from your_table
                                group by registration)    
    

提交回复
热议问题