May 2019
Beginner to intermediate
548 pages
12h 39m
English
In the first part of the SQL statement (SELECT), we can also use the SELECT SINGLE and SELECT DISTINCT options. An example of SELECT SINGLE is as follows:
SELECT SINGLE carrid connid FROM sflight INTO gs_sflight.
When we use the SELECT SINGLE statement, we get only one record. The first row that is found is therefore placed in the results set.
The SELECT SINGLE statement should be used with a where condition, which is explained later in this book.
We can only use a work area as a target. When we use a SELECT SINGLE statement, we cannot use the ORDER BY and APPENDING clauses.
The following is an example of SELECT DISTINCT:
SELECT DISTINCT carrid connid FROM sflight INTO TABLE ...
Read now
Unlock full access