Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CASE WHEN with condition on select value
Message
From
13/04/2015 19:07:49
 
 
To
13/04/2015 17:38:59
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01618336
Message ID:
01618337
Views:
34
This would work:
UPDATE Client
 SET NoProvince=
  (SELECT COALESCE((SELECT TOP 1 (CASE WHEN Invoice.AddUser<>1 THEN Invoice.AddUser ELSE 0 END) AS AddUser FROM Invoice
  WHERE Invoice.NoClient=Client.Numero AND Invoice.NoItem=23
  ORDER BY Invoice.AI DESC),0))
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform