Basic form:
SELECT result FROM source [INTO target] [WHERE condition] [GROUP BY fields] [ORDER BY order].
SELECT clause
Variants:
1. SELECT [SINGLE [FOR UPDATE] DISTINCT] *
2. SELECT [SINGLE [FOR UPDATE] DISTINCT] s1 ... sn
3. SELECT [SINGLE [FOR UPDATE] DISTINCT] (itab)
FROM clause
Variants:
1. ... FROM dbtab
Additions:
1. ... CLIENT SPECIFIED
2. ... BYPASSING BUFFER
3. ... UP TO n ROWS
2. ... FROM (dbtabname)
Additions:
1. ... CLIENT SPECIFIED
2. ... BYPASSING BUFFER
3. ... UP TO n ROWS
INTO target
(This form of the FROM clause works only in conjunction with the INTO clause.)
INTO clause
Variants:
1. ... INTO wa
2. ... INTO CORRESPONDING FIELDS OF wa
3. ... INTO (f1, ..., fn)
4. ... INTO TABLE itab
5. ... INTO CORRESPONDING FIELDS OF TABLE itab
6. ... APPENDING TABLE itab
7. ... APPENDING CORRESPONDING FIELDS OF TABLE itab
WHERE clause
Variants:
1. ... WHERE f op g
2. ... WHERE f [NOT] BETWEEN g1 AND g2
3. ... WHERE f [NOT] LIKE g
4. ... WHERE f [NOT] IN (g1, ..., gn)
5. ... WHERE f [NOT] IN itab
6. ... WHERE f IS [NOT] NULL
7. ... WHERE NOT cond
8. ... WHERE cond1 AND cond2
9. ... WHERE cond1 OR cond2
10. ... WHERE (itab)
11. ... WHERE cond AND (itab)
12. ... FOR ALL ENTRIES IN itab WHERE cond
operator Meaning
EQ or = equal to
NE or <> not equal to
LT or < less than
LE or <= less than or equal to
GT or > greater than or equal to
GE or >= greater than or euqal to
GROUP-BY clause
Variants:
1. ... GROUP BY f1 ... fn
2. ... GROUP BY (itab)
ORDER-BY clause
Variants:
1. ... ORDER BY PRIMARY KEY
2. ... ORDER BY f1 ... fn
3. ... ORDER BY (itab)