ORDER BY

Rick Robinson rickrobinson at attbi.com
Wed Jan 22 16:11:58 CST 2003


Next question...

How does the SQL "ORDER BY" statement work in Valentina? I want to sort 
a list of recipes by their name. The name, which can be up to 80 
characters is stored in a text field. I'd like to also sort by the type 
of recipe (Dessert, Appetizer, Beverage, Snack, etc.)

I have a statement:

c = new vCursor(myDataBase,"select * from recipes where cuisine_fld = 
'" + t + "' ORDER BY type_fld, name_fld")

Then I display these in a list in the order "name" followed by "type".

I get all the recipes of a particular type grouped together in the 
list. But, the names are not in alphabetical order with similarly named 
recipes together. I might get recipes that start with the word 
"Chocolate" spread around throughout the list. Is the ORDER BY sort a 
strict alphabetical sort? Does the length of the text in the field 
change the result?

Rick



More information about the Valentina mailing list