A SQL statement typically used to `UPDATE` records when they exist and `INSERT` them when they do not.

learn more… | top users | synonyms

3
votes
1answer
102 views

3 table merge with some condition

I am new to this forum and I am learning mysql with the help of online resources, currently I am trying to compare and merge table with some conditions Fiddle These are my tables; ...
3
votes
1answer
86 views

Does MERGE updates when not needed?

In SQL Server 2012, Does a merge statement like this : WHEN MATCHED THEN update SET A.len = B.len updates a row even if A.len equals to B.len ? Or does the SQL SERVER knows to ignore this ...
1
vote
1answer
42 views

MySQL: Merge Same Database on Several Location into Single Location

I have registration form, which exactly same for several location. Each of them has REG column, which this field is unique for each row. Basically each data input have different REG number for it, ...
3
votes
0answers
99 views

Once in a while synchronization of the independently updated mysql databases problem

I have a production database and a test database running on MySQL with MyISAM and InnoDB tables, which are updated independently. The Production database is updated by system and sometimes by a user. ...
1
vote
0answers
67 views

RETURNING syntax with multiple columns

Again, another question related to the answer of the one there: Insert with OUTPUT correlated to sub query table So I ended up with this query, written for SQL Server: CREATE TABLE tempIDs ( ...
1
vote
0answers
61 views

How to merge rows based on how much data they have?

I am cleaning data and I formed a table something like this: file | product | color | product_id --------------------------------------------- one.csv pipe blue null ...
1
vote
0answers
192 views

What overhead is there if I MERGE row by row?

I have a target table of about 2000 rows and I want to be able to MERGE (with HOLDLOCK) about 5-10 rows at a time into the target table. The target table doesn't get used heavily, with only 1-2 users ...
0
votes
0answers
34 views

merge in cursor is slow ,any alternative for that in oracle 11g

we have a requirement like below. we need to update one table A from another table B based on joining criteria. both tables are having porper joining columns. Table A has 2 columns missing_order_cw ...
0
votes
0answers
311 views

The OLE DB provider “SQLNCLI10” for linked server “(null)” indicates that either the object has no columns or

When I run the following script its run fine merge RDW_RRR_MAIN_ST.dbo.tmps AS dest USING (select * from RDW_RRR_MAIN_ST.dbo.tmprole cross join RDW_RRR_MAIN_ST.dbo.tmpscreen) as src1 on ...
0
votes
0answers
110 views

Multiple table rows in one row Informix

I have problem just like this one but in Informix. I have table with 2 attributes ID, email like this one: ID email 1 my_mail1@mail.com 2 my_mail2@mail.com 2 my_mail3@mail.com 2 ...
0
votes
0answers
74 views

Merge Similar Schema from one MySQL DB to Another

I have two databases (db1 and db2). db2 has all tables from db1 but not necessarily the same columns. I want to move any missing columns in db2 from tables in db1 but keep the rest unchanged. ...
0
votes
0answers
677 views

Oracle merge query vs correlated update

I have a query which updates a table with data from another table. The current query is written as a correlated update with an exists clause to remove unnecessary rows. The problem is since both of ...