Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inline IIF other than CASE WHEN ?
Message
De
29/10/2013 13:21:53
 
 
À
29/10/2013 13:18:16
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008 R2
Application:
Desktop
Divers
Thread ID:
01586704
Message ID:
01586705
Vues:
50
>Maybe I just drempt it but I thought somewhere I saw a TSQL construct other than the CASE WHEN that emulated the behavior of the VFP IIF()
>
>I'm converting a large number of local views in VFP to remote views and there are alot of IIF statements and I thought the last itme I did this I had seen an alternate way of doing it.
>
>CASE WHEN works fine but its bothering me that I can't remember where I saw this and I figure only other VFP folks would know what I'm talking about.


I doubt this is it....but there's a COALESCE....that will return the first non-null...

COALESCE( Col1, Col2 , Col3, Col4, 'default')

That's the equivalent of...

case when Col1 is not null then Col1
when Col2 is not null then Col2
when Col3 is not null then Col3
when Col4 is not null then Col4
else 'default' end

Again, I doubt that's it, but it's the only one off the top of my head. Maybe someone either has a better memory, or can interpret your dream :)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform