The SELECT statement extracts data from a relational table that meets the criteria you specify. You can use the SELECT statement by itself or within another statement (then called a subquery).
LSQL SELECT columnlist|*asterisk [INTO (hostvarlist)] FROM tablename [WHERE criteria] [GROUP BY criteria [HAVING criteria]] [ORDER BY criteria]
Selects all columns in a table.
Selects values only from the columns you name. Each column name must be separated by a comma.
The search criteria that you are using to match values in the specified columns.
Clause used to specify the tablename from which data is being selected.
Clause used to summarize multiple rows of data into single rows based on the specified criteria.
Clause used, only with a GROUP BY clause, to further limit the output of the statement based on the specified criteria.
The host variables in which to store the selected column values. In a cursor declaration, do not use this parameter since this function is accomplished with the FETCH statement.
Clause used to specify the order of the statement output.
The name of the relational table from which you are selecting.
Notes:
Examples
LSQL SELECT * FROM APPLICATIONS
LSQL SELECT APPL_ID FROM APPLICATIONS
LSQL SELECT APPL_ID FROM APPLICATIONS WHERE STATUS='DOWN'
LSQL DECLARE CURSOR STATDOWN FOR SELECT APPL_ID, STATUS FROM APPLICATIONS WHERE STATUS = 'DOWN'
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |