Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CASE WHEN based on select
Message
De
13/04/2015 11:55:02
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01618310
Message ID:
01618312
Vues:
27
>
>WHEN Client.NoCompany>0 THEN
>
>case when  (SELECT top (1) Company.Activated FROM Company WHERE Company.Numero=Client.NoCompany)=1 then 2
>else 3 end
>end
Thanks, I had this:
UPDATE Client
 SET NoType=
  CASE
  WHEN Client.NoCompany=0 AND Client.NoProvince>0 THEN 1
  WHEN Client.NoCompany>0 THEN
   CASE WHEN EXISTS (SELECT Company.Numero FROM Company WHERE Company.Numero=Client.NoCompany AND Company.Activated=0) THEN 2
   ELSE 3
   END
  END
Is this the same thing?
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform