Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL: ORDER BY clause is invalid
Message
 
 
À
03/04/2005 21:01:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Novell 5.x
Database:
Visual FoxPro
Divers
Thread ID:
01000629
Message ID:
01001130
Vues:
18
>True.
>
>But if we are speaking about the original problem.
>Again assuming that ssno exists in the underlying table.
>
>select distinct last_name, first_name, mid_name, ;
> address1, address2, city, state, zip_code, ;
> ' ' as packet_id, ssn, right(ssn,4) as ssno ;
> from temp ;
> order by ssno, ssn
>
>Does work in 8. Does work in MS SQL ( with a few changes :) ).
>Does not work in 9.

You still missing the point. It doesn't work in VFP8 because result is sorted on the ssno field not on the ssno expression from the query. With DISTINCT clause and the ssno field not presented in the field list there's no way to be sure from which record the field will come. It's basicaly the same problem as with GROUP BY not including all non-aggregated fields.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform