Filter duplicate rows based on a field

后端 未结 4 841
余生分开走
余生分开走 2021-01-01 23:39

I have several records (bills) that are basically duplicates of each other, except for one field, which represents the language that bill is in.

For example:

<
4条回答
  •  时光取名叫无心
    2021-01-02 00:24

     select
     BillID,Account,Name,Amount,max(Lang)
     FROM Bills 
     WHERE Account='abcd'
     group by BillID,Account,Name,Amount;
    

    Same as user2407394 except without the ID in the groupby, since that would return 3 too.

提交回复
热议问题