List:General Discussion« Previous MessageNext Message »
From:Yesmin Patwary Date:March 22 2006 2:56pm
Subject:INSERT...SELECT Query Help Request.
View as plain text  
Dear All,
   
  First of all, I would like to thank Shawn Green, Peter Brawley and Josh for their kind
help in my previous issue.
   
  I have a table named master_list with two field customer_id and list_code.  I need to
insert only non existent records in master_list from a child_list. Both master_list and
child_list table structure are identical but data in child_list may contain records from
master_list and new records.  
   
  I have constructed query using INSERT┬ůSELECT but I am unable to check and filter out
records that already exist in master_list.
   
  INSERT INTO master_list (customer_id,list_code)  SELECT DISTINCT customer_id,list_code
FROM child_list
   
  Is there anyway to check and insert records in master_list without creating dups?
   
  Thanks in advance for any help.

		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 
Thread
Compare lists Query?Yesmin Patwary10 Mar
  • Re: Compare lists Query?Josh10 Mar
    • Re: Compare lists Query?Yesmin Patwary13 Mar
      • Re: Compare lists Query?Peter Brawley13 Mar
      • Re: Compare lists Query?Josh13 Mar
        • Problems with timestamp field after upgrading MySQL Server.Yesmin Patwary13 Mar
          • Re: Problems with timestamp field after upgrading MySQL Server.Josh13 Mar
            • Re: Problems with timestamp field after upgrading MySQL Server.SGreen13 Mar
        • Problems with timestamp field after upgrading MySQL Server.Yesmin Patwary13 Mar
        • INSERT...SELECT Query Help Request.Yesmin Patwary22 Mar
          • Re: INSERT...SELECT Query Help Request.SGreen22 Mar