This is an old revision of the document!


Administration: Omnidex Indexing

ActiveCounts

The SQL Behind ActiveCounts

The example on the previous page demonstrated ActiveCounts in a web page; however, ActiveCounts is not a set of web controls. ActiveCounts is really just a powerful set of SQL statements that are highly optimized using the Omnidex indexes. This means that ActiveCounts can be implemented in any application that calls SQL.

ActiveCounts is accomplished using SQL statements that request a set of values and their counts based on the criteria so far. The following basic SQL statements supply the counts needed for the example on the previous page.

First, the user requested to see the states and their counts:

select        STATE, count(*)
  from        LIST
  group by    STATE

The user selected the states in the Western United States, and then requested to see the Genders and their counts:

select        GENDER, count(*)
  from        LIST
  where       STATE in ('AZ','CA','CO','NM','OR','UT','WA')
  group by    GENDER

The user selected the Women in the Western United States, and then requested to see the Educations and their counts:

select        EDUCATION, count(*)
  from        LIST
  where       STATE in ('AZ','CA','CO','NM','OR','UT','WA') and 
              GENDER = 'F'
  group by    EDUCATION

The user selected those people with graduate degrees, and may have continued narrowing his search.

As you can see, these SQL statements simple request counts that are filtered by the criteria entered so far, grouped by the next value they want to see. The simplicity of this approach allows it to be more easily integrated into an application.

First, the user requested to see the states and their counts:

Additional Resources

See also:

 
Back to top
admin/indexing/activecounts/sql.1295626787.txt.gz ยท Last modified: 2016/06/28 22:38 (external edit)