Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multipe columns in a CASE statement?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00498725
Message ID:
00498818
Vues:
14
SELECT SUM(
CASE WHEN ds_progedd.dbo.Demos.Strata = 2 AND type = 'IMMU'
         THEN 1
     ELSE
         0
END) AS standard_inmu
>I need to take VFP code and create a SP to do likewise. It's a cross tab so this is what I have currently:
>SUM(IIF(ds_progedd.dbo.Demos.strata=2
>and type ='IMMU',1,0)) AS standard_immu ,
>
>How do you Case on 2 columns
>SUM(caseds_progedd.dbo.Demos.strata when 2
>and type when 'IMMU' then 1 else 0) AS standard_immu ,
>
>TIA
>
>__Stephen
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform