Withdata Software

Producing high-quality database tools

Main menu

Skip to primary content
Skip to secondary content
  • Withdata Software
  • Blog
  • Categories
  • Tags

Tag Archives: merge into

Upsert a row Into Mysql Table

Posted on March 13, 2018 by Shiji Pan

In Mysql, if you want to either updates or inserts a row in a table, depending if the table already has a row that matches the data, you can use “ON DUPLICATE KEY UPDATE”. INSERT INTO employees(id, name, hire_date ) VALUES (1, 'John', '2016-11-29' ) ON DUPLICATE KEY UPDATE ... Read more

Posted in Mysql | Tagged merge into, Mysql, replace into, upsert

Replace Update or Insert a row Into PostgreSQL Table

Posted on August 1, 2013 by Shiji Pan

In Mysql, if you want to either updates or inserts a row in a table, depending if the table already has a row that matches the data, you can use “ON DUPLICATE KEY UPDATE”. How to do it in PostgreSQL? A way to do an “UPSERT” in postgresql is to do two sequential ... Read more

Posted in PostgreSQL | Tagged merge into, PostgreSQL, replace into, upsert

Replace Update or Insert a row Into Sqlite Table

Posted on August 1, 2013 by Shiji Pan

In Mysql, if you want to either updates or inserts a row in a table, depending if the table already has a row that matches the data, you can use “ON DUPLICATE KEY UPDATE”. How to do it in Sqlite? Use “INSERT OR REPLACE INTO” . For example: INSERT OR REPLACE INTO Employee ... Read more

Posted in Sqlite | Tagged merge into, replace into, Sqlite, upsert

Replace (Update/Insert) a row into DB2 table – Merge into

Posted on June 6, 2013 by Shiji Pan

In MySQL,  if you want to either updates or inserts a row in a table, depending if the table already has a row that matches the data, you can use “ON DUPLICATE KEY UPDATE”. How to do it in DB2? Use “merge into” . MERGE INTO table_to_upsert AS tab USING (VALUES ... Read more

Posted in DB2 | Tagged DB2, merge into, replace into, upsert

Replace (Update/Insert) a row into SQL Server table

Posted on June 4, 2013 by Shiji Pan

In MySQL,  we use “ON DUPLICATE KEY UPDATE” to either updates or inserts a row in a table. How to do it in SQL Server? Just like this: if not exists (select 1 from employees where employee_id = 1) insert into employees (employee_id,last_name,first_name) values ( 1,'smith', ... Read more

Posted in Sql Server | Tagged merge into, replace into, Sql Server, upsert

Replace (Update/Insert) a row into Oracle table – Merge into

Posted on June 4, 2013 by Shiji Pan

In Mysql,  if you want to either updates or inserts a row in a table, depending if the table already has a row that matches the data, you can use “ON DUPLICATE KEY UPDATE”. How to do it in Oracle? Use “merge into” . MERGE INTO employees USING dual ON ( "id"=123456 ... Read more

Posted in Oracle | Tagged merge into, Oracle, replace into, upsert

Recent Posts

  • Use Cases for Dumping to CSV
  • Convert Text to Speech by CSV / TSV
Withdata Software. ©2004 - 2025 All rights reserved.