You use the SQL commands to specify the tables and records you wish to extract or update. The main commands are:
Extract Records |
SELECT <expression> FROM <table> WHERE <condition> GROUP BY <fields> HAVING <condition> |
Update Records |
DECLARE <name> CURSOR FOR <select statement> |
Fetch the Next Record |
FETCH FIRST/LAST/PRIOR/NEXT; |
Insert a Record |
INSERT INTO <table fields>; |
Manage Updates |
COMMIT WORK; |
Date and Time |
DATE(); TIME(); DAY(); MONTH(); YEAR(); HOUR(); MINUTE(); SECOND(); DAYS(); |
Below is an example SQL program excerpt to print out a list of the customers assigned to each employee by region:
|