Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select with case when
Message
 
À
07/06/2001 08:25:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00516210
Message ID:
00516402
Vues:
15
Hi Cetin,

Okay thanks, I guess I should have windered why I was having trouble finding out anything about the "case when then".

This is the solution, thanks to you.

select name, ;
sire1, ;
grade, iif(grade = "A+","1",;
iif(grade="A","2",;
iif(grade="A-","3",;
iif(grade="B+","4",;
iif(grade="B","5",;
iif(grade="B-","6",;
iif(grade="C","7"," "))))))) as gradeorder ;
from master ;
where grade # " " ;
order by name





>>
>>James,
>>SQL server does that but this kind of case is not allowed in VFP SQL.
>>You could do something like :
>>
>>
Select name, sire1, ;
>>  iif(grade = "A+",1,;
>>  iif(grade = "A",2,;
>>  iif(grade = "B+",3,;
>>  iif(grade = "B",4,;
>>  iif(grade = "A",2,;
>>))))) as gradeorder from master where grade # " " order by name
Cetin
>
>Last grade= "A" ... is a leftover from pasting.
>Cetin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform