Riesch Nicolas wrote:

> I don't know much about sapdb yet.
> I have just read the documentation so far, and before 
> installing it, I just
> wanted to know something.
> 
> Using sql, I use very often this kind of sql statement:
> 
> UPDATE table1
> SET table1.colA = table2.colAA
>        table1.colB = table2.colBB
>        table1.colC = table2.colCC
> FROM table2
> WHERE table1.col1 = table2.col2
> 
> This sql statement updates columns "colA", "colB" and "colC" 
> of "table1"
> based on values of colums "colAA", "colBB" and "colCC" of the 
> joined table
> "table2".
>  
> It works on MS SQL Server, and this syntax seems to be valid 
> on postgresql
> and db2, as far as I know.
> 
> Does it works on sapdb ?
> ( I browsed the documentation, and it seems that this syntax is not
> accepted. That's why I ask to be sure ...)
> 
> If not, what sql statements do you use to achieve the same 
> result with sap db ?

UPDATE table1 SET (colA, colb, colc) = 
  (SELECT colaa, colbb, colcc FROM table2 WHERE table1.col1=table2.col2)

Elke
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to