docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 3.3TutorialsDatabase Tutorial
Copyright  2004, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com



Privileges
Building a Sample Database
The query() function
The big_query() function
Quoting
SQL Syntax
Conditions
Sorting
Limiting
Functions
Features Missing from MySQL
Insertion Syntax
The tablify Container
The Business Graphics Module
The emit and sqlquery Tags
Database Creation
Creating Tables
Indices
Dropping

Sorting

Data in a result is in undefined order. To have it sorted to some other order, the ORDER BY clause can be used. It modifies the basic query syntax:


SELECT <columns> FROM <table> [, <table> ...] WHERE <condition> 
       ORDER BY <column name> [DESC] [, <column name> [DESC] ...]

This will sort the returned rows according to the specified columns, depending on the column type (numerically if the column type is numeric, syntactically if the column type is textual, etc.) If the DESC modifier is specified, the rows will be sorted in reverse (descending) order.