Database Reference
In-Depth Information
Figure 14.2
An SQL Inline
Searched CASE
Statement
Example.
Here is a second example of an inline CASE statement expression using
a searched CASE statement format. The result is shown in Figure 14.2.
SELECT COUNTRY, SUM(REVENUE)
,CASE
WHEN SUM(REVENUE) BETWEEN 200 AND 300 THEN 'Negligible'
WHEN SUM(REVENUE) BETWEEN 301 AND 500 THEN 'Market Research'
WHEN SUM(REVENUE) >= 500 THEN 'A Winner!'
ELSE 'Non-Existent' END
FROM SALESSUM GROUP BY COUNTRY;
Objects
. Objects are accessed as TABLE.TYPE.ATTRIBUTE. In
other words, a table containing a type definition (collection or struc-
ture) will have type column names accessed by the table, the type
name, and followed by the name of the attribute (column) defined
within the type. Object datatypes are covered in Chapter 16.
Search WWH ::




Custom Search