Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to put conditional where clauses?
Message
De
17/12/2007 03:59:25
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
How to put conditional where clauses?
Divers
Thread ID:
01276215
Message ID:
01276215
Vues:
62
Hello all,

I need a sql querie that returns some rows like this:
select a.id, a.name, a.type, a.type1, a.type2, a.selection where a.type = (case a.selection = '1' a.type1 else b.type2 end)
or
select a.id, a.name, a.type, a.type1, a.type2, a.selection where a.type = iif(a.selection = '1', a.type1, b.type2)
I know thar 'iif' is not permited in Sqlsrvr, on the other hand it seems that i can't use 'case else end' in a where condition, so how to acomplish a mission like this?

Thank you all,
Joaquim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform