Update MySQL table and ignore duplicate entries

后端 未结 2 1226
清歌不尽
清歌不尽 2020-12-29 18:29

I created a table that contains a UNIQUE \'mobile_no\' like

09727048248
9727048248
9824578564
9898998998

Then I am going to check whether o

2条回答
  •  情深已故
    2020-12-29 18:52

    Use UPDATE IGNORE:

    update IGNORE bccontacts 
    set mobile_no='919727048248' 
    where mobile_no=09727048248
    

    More info here: http://dev.mysql.com/doc/refman/5.0/en/update.html

提交回复
热议问题