Scalable Database Server, HiRDB Version 8 Description

[Contents][Glossary][Index][Back][Next]

5.2.8 Data processing

When data is extracted from a table, it is possible to process that data by grouping it or by sorting it in ascending or descending order. The data processing methods and an SQL specification example follow.

Data processing methods
The following operations can be used to process data in a table:
  • Data grouping (GROUP BY clause specification and the set function)
  • Sorting data in ascending or descending order (ORDER BY clause specification)
  • Excluding duplicate data (DISTINCT specification)
  • Set operations between sets of rows (derived tables) (UNION or EXCEPT specification)

Data processing SQL specification example
An example of rearranging (sorting) data into ascending order is explained as follows.
Example
In this example, the SELECT statement retrieves from the stock table (STOCK) the product codes (PCODE) and stock quantities (SQUANTITY) of products and sorts so that the retrieved data is in ascending order of the product codes (PCODE):
 
SELECT PCODE,SQUANTITY FROM STOCK
  ORDER BY PCODE