Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT w- IF NOT EXISTS

Status
Not open for further replies.

admoore

IS-IT--Management
May 17, 2002
224
US
Query as follows produces error:
Code:
INSERT INTO new_table(id) IF NOT EXISTS
SELECT phone as id FROM `orig_table` WHERE disposition = 'DNC'
newtable(id) is primary key and I wish to prevent INSERT from failing due to duplicate records in SELECT query.

Also, is there a way to include a static value to a field in the new_table, i.e. code=staticvalue as part of the query syntax?

Hopefully this is s†a†ed clearly.

TIA,

-Allen M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top