Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying progress records by sorting using any one attribute

Displaying progress records by sorting using any one attribute. I am new to progress so I want to know that how records in table can be displayed according to sorting on one attribute.

like image 349
sajid shaikh Avatar asked Sep 08 '11 12:09

sajid shaikh


1 Answers

You use the BY phrase like so:

for each customer no-lock where customer.custNum > 100 BY customer.name:
  display customer.custNum customer.name.
end.

Keep in mind that selection and sorting are two different things -- the WHERE clause specifies selection (and in the absence of BY specifies the sort order), the BY specifies sorting.

BY will influence index selection only if there is a tie between two or more possibilities in the WHERE clause.

If the BY order does not match the WHERE order client side sorting may cause a significant performance penalty. (You can compile with XREF to see what indexes are being used and how well they match your desires.)

like image 73
Tom Bascom Avatar answered Sep 30 '22 16:09

Tom Bascom