cleaning up db of redundant data

前端 未结 5 1660
时光说笑
时光说笑 2020-12-07 04:54
locid   country city
39409   US  Aaronsburg
128426  US  Aaronsburg
340356  US  Aaronsburg
429373  US  Aaronsburg
422717  US  Abbeville
431344  US  Abbeville
433062           


        
5条回答
  •  孤城傲影
    2020-12-07 05:33

    delete these recordds

    select T2.* from ( 
         select country city,max(locid)locid
         from 
         group by country city)T1
         join
         select * from 
    T2 where T2.locid<>T1.locid

    提交回复
    热议问题