SQL How to remove duplicates within select query?

前端 未结 7 760
甜味超标
甜味超标 2021-01-04 07:05

I have a table which looks like that:

\"alt

As You see, there are some date duplicates, so how t

7条回答
  •  借酒劲吻你
    2021-01-04 07:32

    If you want to select any random single row for particular day, then

    SELECT * FROM table_name GROUP BY DAY(start_date)
    

    If you want to select single entry for each user per day, then

    SELECT * FROM table_name GROUP BY DAY(start_date),owner_name
    

提交回复
热议问题