In this example, rows for which ITMNO is 123 are fetched from the STOCK table.
Example 2:
In this example, rows for which STOCKQTY is less than 50 are fetched from the STOCK table.
SELECT ... FROM STOCKS. STOCK WHERE STOCKQTY < 50
Example 3:
In this example, rows for which "PRICE x ORDERQTY" is 1,000,000 or less are fetched from the
ORDER table.
SELECT ... FROM STOCKS. ORDER
WHERE PRICE * ORDERQTY <= 1000000
Example 4:
In this example, rows for which STOCKQTY is greater than 500 are fetched from the STOCK table.
SELECT ... FROM STOCKS. STOCK WHERE STOCKQTY > 500
Example 5:
In this example, rows for which STOCKQTY is 500 or greater are fetched from the STOCK table.
SELECT ... FROM STOCKS. STOCK WHERE STOCKQTY >= 500
Example 6:
In this example, rows for which PRODUCT is other than TELEVISION are fetched from the STOCK
table.
SELECT ... FROM STOCKS. STOCK WHERE PRODUCT < > 'TELEVISION'
The following are examples in which logical operators are used to group and specify several comparison predicates.
Example 7:
In this example, rows for which PRODUCT is TELEVISION and STOCKQTY is 90 or greater are
fetched from the STOCK table.
SELECT ... FROM STOCKS. STOCK
90