Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement How To
Message
 
 
À
09/06/2009 14:42:02
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Desktop
Divers
Thread ID:
01404764
Message ID:
01404825
Vues:
44
>It's pretty complicated to say the least. I was hoping I would be able to write a statement that just checked for a students existence in each subquery. I was thinking of using ICASE but I wasn't sure if I could use that in conjunction with "Where exists ( Select * from level5)".

You can use CASE with EXISTS
CASE 
  WHEN EXISTS (Select 1 from level5) THEN 5 
  WHEN EXISTS (Select 1 from level4) THEN 4 
  ...
  ELSE 0 
END AS StudentLevel
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform