Hitachi

Hitachi Advanced Database SQL Reference


1.4.1 Example: Specify the maximum number of rows in the retrieval results

Search the sales history table (SALESLIST) and display the top three results ordered by quantity purchased (PUR-NUM).

Table to search

[Figure]

Specification example
SELECT "USERID","PUR-CODE","PUR-NUM","PUR-DATE"
    FROM "SALESLIST"
    ORDER BY "PUR-NUM" DESC
    LIMIT 3
Retrieval results

[Figure]