Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Order By Clause is Invalid
Message
 
 
À
31/03/2013 04:50:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01569579
Message ID:
01569591
Vues:
48
>I have trying to retreive Data from a Table. The said Table has account Number and Amout Payable as Fileds.
>
>The same Account Number can have many amount payable so I am trying to extract Account number wise Highest Value of Amount payable.
>
>I tried this and it worked fine.
>
>
>Select Accountno, MAX(Amtpayable) from Accountpayale Group by Accountno Order by accountno
>
>
>But when I triied this it gave me "Error Order By Clause is Invalid"
>
>Select Accountno, MAX(Amtpayable) from Accountpayale Group by Accountno Order by Amtpayable
>
>
> So in the above case If I need data in Order of Amount payable, what should I do ?

You need to give an alias to your computed column and add that alias in the ORDER BY, e.g.
Select Accountno, MAX(Amtpayable)  AS MaxAmtPay from Accountpayale Group by Accountno Order by MaxAmtPay
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform