Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

only insert new values

Posted on 2012-08-31
2
Medium Priority
?
889 Views
Last Modified: 2012-08-31
insert into table2.varcharColumn1 values table1.varcharColumn1 where table2.varcharColumn1 does not exist

I only want to insert new values in this new table
0
Comment
Question by:rgb192
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 38354557
this should do:

insert into table2 (varcharColumn1)
 select t1.varcharColumn1 
   from table1 t1
  where not exists( select null from table2 t2 where t2.varcharColumn1 = t1.varcharColumn1) 

Open in new window

0
 

Author Closing Comment

by:rgb192
ID: 38354576
http://www.experts-exchange.com/Database/MySQL/Q_27849462.html

thanks

I have a more difficult question that has update
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question