Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select with case when
Message
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:
00516909
Vues:
8
>Hello All,
>
>I'm trying to use a case when in this select to order classifications. The grades available, in order of importance are A+,A,B+,B,C+,C.
>
>I want to create a select that will translate these so a report can be ordered by importance.
>
>This returns an error message:
>
>
>Select name, sire1, case when grade = "A+" then "1", grade = "A" then "2", grade = "B+" then "3" end as gradeorder from master where grade <> " " order by name
>
>Any help would be appreciated.
>
>Jim Harvey
>jharvey@netrax.net

I don't know about the speed implications of this or the other solutions, but how about using a second table containing the grades & a numeric value & sql along lines of :
select name, sire1, grade, gradeval from grades a, gradetbl b where a.grade=b.grade order by 4
Len Speed
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform