Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL: ORDER BY clause is invalid
Message
De
04/04/2005 09:23:12
 
 
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:
01001187
Vues:
15
Nadya,

it's only when you use the DISTINCT keyword.

>Dan,
>
>Did I understand correctly, that all fields for ORDER BY clause must present in the select statement? E.g. this statement
>
>SELECT TOP m.lnNumAccounts TRANS.cTrans_Pk, ;
>		Trans_Employees_Queues.cTrans_Employees_Queues_Pk, 0 AS iAssigned, ;
>		SPACE(16) AS cCommission_Owner_UsGrLink_fk, ;
>		SPACE(16) AS cqueue_names_fk ;
>		FROM mmVisCollect!TRANS INNER JOIN mmVisCollect!Trans_Employees_Queues ;
>		ON TRANS.cTrans_Pk = Trans_Employees_Queues.cTrans_fk ;
>		WHERE ISNULL(Trans_Employees_Queues.cCommission_Owner_UsGrLink_fk) ;
>		AND Trans_Employees_Queues.cqueue_names_fk = m.lcQueue_Names_Fk ;
>		ORDER BY TRANS.tDate_Received ;
>		INTO CURSOR curAccounts READWRITE
>
>is not going to work in VFP9?
>
>>< pre >
>>>
>>>"That's the rule VFP engine uses since forever. Too bad it's not documented."
>>>
>>>Too bad it's the rule for VFP that's not fixed when the engine has changed.
>>>
>>>Cetin
>>
>>I agree. That's a bug. It worked for the most part in vfp8. Now it fails in vfp9.
>>
>>In sql server no such problem. Foxpro shouldn't be looking at the underlying fields in the table in the order by clause, just the fields that were selected.
>>
>>So to recap
>>
>>The most likey reason this errors is because ssno just happens to a field in the table.
>>
>>select distinct last_name, first_name, mid_name, ;
>> address1, address2, city, state, zip_code, ;
>> ' ' as packet_id,ssn, right(a.ssn,4) as ssno ;
>> from temp ;
>> into cursor address ;
>> order by ssno, ssn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform