SQL Sequence Grand Aggregate Approxdc Function

The seq_approxdc() function returns an integer count of the distinct values in the sequence.

Following is an example script demonstrating the seq_approxdc() function:

 
 
    INSERT INTO SimpleSequence(testNumber,fVal1)
    VALUES(4,'{1.1,1.1,2.2,3.3}');
     
    SELECT fVal1, seq_approxdc(fVal1) AS "approxdc"
    FROM SimpleSequence WHERE testNumber = 4;
     
    fVal1       				    approxdc
    -----------------------------------------------------
    {1.100000, 1.100000, 2.200000, 3.300000}     3
     

Sample script

A sample script to demonstrate this select statement using xSQL can be run from the samples/xsql/scripts/financial directory with the following command:

     
    f 1