Hitachi

Hitachi Advanced Database SQL Reference


1.3.1 Example 1: Sort retrieval results by customer ID

Sort all of the data in the customer table (USERSLIST) by customer ID (USERID). The customer table consists of columns for customer ID (USERID), name (NAME), and sex (SEX).

Table to search

[Figure]

Specification example
SELECT "USERID","NAME","SEX"
    FROM "USERSLIST"
    ORDER BY "USERID" ASC
Retrieval results

[Figure]

Note

The name of the column to be sorted on is specified in the ORDER BY clause. In this example, we are sorting by customer ID, so we specify USERID in the ORDER BY clause.