phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alchemist <alchemistsrivast...@gmail.com>
Subject Re: How to support UPSERT with WHERE clause
Date Mon, 16 Jul 2018 20:20:52 GMT
I did  following:

CREATE TABLE
CREATE TABLE IF NOT EXISTS TESTTABLE1 (PK VARCHAR NOT NULL PRIMARY KEY,
CF.COL1 VARCHAR, CF.COL2 VARCHAR, CF.COL3 VARCHAR, CF.MEDIAID VARCHAR);

UPSERT DATA
UPSERT INTO TESTTABLE1 (PK , CF.COL1 , CF.COL2 , CF.COL3 , CF.MEDIAID
)VALUES ('row1', 'data1','data2','data3','123');

UPSERT INTO TESTTABLE1 (PK , CF.COL1 , CF.COL2 , CF.COL3 , CF.MEDIAID
)VALUES ('row2', 'data21','data22','data23','1234');


UPDATE DATA USING FOLLOWING but it did not work
UPSERT INTO TESTTABLE1 (CF.COL1 , CF.COL2 , CF.COL3 )  SELECT  'xxx1',
'yyy1', 'zzz1'  FROM TESTTABLE1  WHERE MEDIAID = '123' and PK ='row1';





--
Sent from: http://apache-phoenix-user-list.1124778.n5.nabble.com/

Mime
View raw message