SQL Select Statement for Order By in Ax 2012

I am using the same table Bill_TabMethod for SQL Count.

Bill_TableData

Step 1. Write the below SQL Select statement in a Job like below

CODE:

static void SQLArrangeDesc(Args _args)

{

Bill_TabMethod btm;

while select * from btm order by btm.TotalAmt desc

print btm.TotalAmt;

pause;

}

Step 2. Run the code you will get the Result as

orderbyDesc