Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF In Select - How To?
Message
De
19/03/2010 11:47:04
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
IIF In Select - How To?
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Desktop
Divers
Thread ID:
01455728
Message ID:
01455728
Vues:
84
I'm trying to add a status column to a select statement based on the contents of a different file. I'm trying to pull the customer number from the customer file and the value of 1 or 3 as nstatus. This status value needs to be 1 if the customer is found in the following (select custno from arship where dContract_Exp is null) and 3 if it is not.
select custno, iif(custno in (  select custno from arship where dContract_Exp is null ), 1, 3) as nstatus from dbo.customer
TIA
Jeff
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform