Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Upsert data in one Table based on data in another Table?

$
0
0

Hi,

 

Is it possible to UPSERT data in one table based on data in a different table?

 

Here is the scenario:

 

CREATETABLE T (COL INT, VAL INT);

INSERTINTO T VALUES (1, 1);

INSERTINTO T VALUES (2, 2);

 

 

CREATETABLE u (COL INT, VAL INT);

INSERTINTO u VALUES (1, 4);

INSERTINTO u VALUES (3, 3);



UPSERT something like this:


UPSERT T

VALUES (U.COL, U.VAL)

FROM   T, U

WHERE  T.COL=U.COL;


What I finally want to see in the Table T is

1,4

2,2

3,3




Thanks,

Varun Vemala


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>