I ha开发者_运维知识库ve table :
number city1 city2 mentions
1 a b 5
1 b a 5
1 c d 2
1 d c 2
what I need is to remove duplicate records, such as a, b equal to b,a became :
number city1 city2 mentions
1 a b 5
1 c d 2
any clue for me ?
thanks before :)
Like this?
delete from table t1
where exists (
  select *
  from table t2
  where
    t2.number = t1.number and
    t2.city1 = t1.city2 and
    t2.city2 = t1.city1 and
    t2.mentions = t1.mentions and
    t2.city1 < t2.city2
)
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论