Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update table with left join
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Desktop
Divers
Thread ID:
01526632
Message ID:
01526635
Vues:
29
Thanks, I haven't thought about that, then it's better to write INNER JOIN to make that more clear.

>- SQL Server is picky about order of the clauses in a statement. They should be in the order as shown in BOL
>- 'WHERE HistItems.DelFlag = 0' effectively turns your LEFT JOIN into INNER JOIN.
>
>>is something like this possible? I get an error, but I thought it should have worked:
>>
>>UPDATE EmpItems 
>>    LEFT JOIN HistItems ON HistItems.eiKey = EmpItems.eiKey
>>    WHERE HistItems.DelFlag = 0 
>>    SET EmpItems.itOnPosted = 1, EmpItems.itBalAmt = HistItems.itBalNew + HistItems.itPostCalc
>>
>>Maybe I'm doing something wrong?
Christian Isberner
Software Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform