SQL Select Distinct column and latest date

后端 未结 2 634
天命终不由人
天命终不由人 2021-02-08 19:01

I\'m looking to select just the latest records of a table based on date, but only one one Distinct listing of each of the urls. The table structure is like this;



        
2条回答
  •  时光取名叫无心
    2021-02-08 19:36

    This is actually pretty easy to do using simple aggregation, like so:

    select URL, max(DateVisited)
    from 
    group by URL
    

    提交回复
    热议问题