H2 1.1.112

CREATE TABLE
TEST_A(  A INTEGER,  PUBLICID VARCHAR(20) NOT NULL,  ID INTEGER NOT
NULL);

CREATE TABLE
TEST_AB( AB INTEGER, AID INTEGER, PUBLICID VARCHAR(20) NOT NULL, ID
INTEGER NOT NULL);

INSERT INTO  TEST_A(A, PUBLICID, ID)
VALUES(11, '1', 1);

INSERT INTO TEST_AB(AB, AID, PUBLICID, ID)
VALUES(31, 1, '1', 1),(32, 1, '2', 2);

MERGE INTO test_ab (AID, AB)     KEY (AID)
SELECT test_ab.AID, (test_ab.AB + 2000)  FROM test_ab test_ab
INNER JOIN test_a test_a
ON (test_a.ID = test_ab.AID AND test_a.A = 11);

select * from test_a;
select * from test_ab;

I want MERGE to update AB but it fails because it apparently is trying
to merge 2 rows into one row. Why doesn't
it iteratively find each row and update AB for each row? That's what I
want.

Thanks!
Randy

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to