Wikipedia:

Merge

(SQL)

A relational database management system uses SQL MERGE (aka. upsert) statements to INSERT new records or UPDATE existing records depending on whether or not a condition matches. It was officially introduced in the SQL:2003 standard.

MERGE INTO table_name USING table_name ON (condition)
WHEN MATCHED THEN UPDATE SET column1 = value1 [, column2 = value2 ...]
WHEN NOT MATCHED THEN INSERT column1 [, column2 ...] VALUES (value1 [, value2 ...])

Some database management systems (like, e.g. MySQL) support SQL-command REPLACE, having the same effect.[1]

References

  1. ^ http://dev.mysql.com/doc/refman/5.1/en/replace.html

External links


 
 
 

Join the WikiAnswers Q&A community. Post a question or answer questions about "Merge" at WikiAnswers.

 

Copyrights:

Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Merge (SQL)" Read more

Search for answers directly from your browser with the FREE Answers.com Toolbar!  
Click here to download now. 

Get Answers your way! Check out all our free tools and products.

On this page:   E-mail   print Print  Link  

 

Keep Reading

Mentioned In: