>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 ?
To add to what Thomas said, the reason the second way doesn't work is that Amtpayable (by itself) is not a column in the Select.