IACONE Roberto  wrote:

> 
> Hi
> 
> we aim to migrate our databases to SAP from M$ SQL 7.0, but 
> before we are
> testing the different features.
> 
> We have issues about updates on a table using the values 
> coming from columns
> of another one.
> 
> This update statement works on SQL 7.0 but not on SAP.
> 
> ---------------------------
> UPDATE A
> SET A.AgenteDiZona = L.Agente+' ('+L.SettoreZona+')'
> FROM (AnagraficheTemp A INNER JOIN ListaAgenti L ON A.CAP = L.CAP)
> ---------------------
> 
> Could you please give us a tip or trick?
> 

Something like

Update AnagraficheTemp A set AgenteDiZona  = (select  L.Agente || ' (' || 
L.SettoreZona || ')'
                                                                       from 
ListaAgenti L
                                                                       where A.CAP = 
L.CAP)

should do, of course only if exactly 0 or 1 row in L will result in the subquery for 
each row in A.

Elke
SAP Labs Berlin

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to