ballouta Posted February 3, 2010 Share Posted February 3, 2010 Hello I am using this query to merge two tables of same stucture, both contains email address, the one problem i have is that there's duplicated entries: insert into `mlist_01` (`email`) select DISTINCT(`email`) from `mlist_02` is it possible to ask the query to avoid duplicated emails and leave them? thank You Quote Link to comment https://forums.phpfreaks.com/topic/190743-merging-two-tables/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 3, 2010 Share Posted February 3, 2010 Your email column should already be a unique index to enforce uniqueness, then just use the IGNORE keyword - insert IGNORE into `mlist_01` (`email`) select DISTINCT(`email`) from `mlist_02` Quote Link to comment https://forums.phpfreaks.com/topic/190743-merging-two-tables/#findComment-1005893 Share on other sites More sharing options...
ballouta Posted February 3, 2010 Author Share Posted February 3, 2010 wonderful it is working, u r genius many thanks Quote Link to comment https://forums.phpfreaks.com/topic/190743-merging-two-tables/#findComment-1005900 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.