Database Reference
In-Depth Information
So Figure 14.6 shows us what data we have, with a restriction. Now let's
run a very simple query, grouping by country and applying all the expres-
sion filters stored in the SALESANALYSIS table. The EVALUATE operator
applies expression filters. The result is shown in Figure 14.7.
SELECT DISTINCT SD.CONTINENT, COUNT(*)
FROM SALESANALYSIS SA, SALESDATA SD
WHERE EVALUATE (SA.FILTER
, HitCD.getVarchar(SD.CONTINENT, SD.COUNTRY, SD.GENRE))=1
GROUP BY SD.CONTINENT, SD.COUNTRY;
Examining the SALESANALYSIS table filter entries and Figure 14.6, it
should be obvious that all expression filters have been applied in Figure
14.7. Only the United States, Mexico, and Argentina have SALESDATA
view rows for American Soft Rock; the United Kingdom does not. This is
shown with greater clarity by going a small step further and grouping by
both continent and country. The script following will suffice. The result is
shown in Figure 14.8.
SELECT SD.CONTINENT, SD.COUNTRY, COUNT(*)
FROM SALESANALYSIS SA, SALESDATA SD
WHERE EVALUATE(SA.FILTER
, HitCD.getVarchar(SD.CONTINENT,SD.COUNTRY, SD.GENRE))=1
GROUP BY SD.CONTINENT, SD.COUNTRY;
Figure 14.7
Apply the
Expression Filters
in the
SALESANALYSIS
Table.
Search WWH ::




Custom Search