[DONE] Aggregation with GROUP BY clause

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jun 30 08:17:50 CDT 2004


On 6/30/04 1:25 AM, "Igor Gomon" <giv at tlc.kherson.ua> wrote:

Hi Igor,

> Hi team,
> 
> I've done implementation of aggregative nodes working on groups
> (when GROUP BY clause specified in SELECT).

You need add: for single table.
 
> Existing implementations of aggregative value calculation was incorrect
> in case when value was calculated on group so I've corrected it for
> all aggregative nodes.

ok

> Also I write new test that tests GROUP BY clause with aggregation on
> single table - 
> 
>   Test_VSQL_Select_AVG_For_Int_With_GroupBY_Only()
> 
> (since I cannot find any such tests - most of existing tests are
> too complex for my case).

Hmm, Ivan. Why they are complex?

> Test is passed OK.

Igor, so am I right that Ivan's SQL test for GROUP BY now done ok ?
And your new also?

Igor, am I right that query as
    
    SELECT f1 AGGR_FUNC( DISTINCT f2)
    FROM T  
    GROUP BY f1 

Also works now?


Excellent guys!


-----
Now the next tasks for you:

1) 
    SELECT DISTINCT some field
    FROM T

    SELECT DISTINCT some field
    FROM T
    WHERE find something



2) check what tests have Ivan for case when aggregative functions are on the
JOIN table

    SELECT T1.a1, AGGR( T2.b4 )
    FROM T1 join T2
    GROUP BY T1.a1

May be add more tests.
After this we will start implement this kind of query.

Igor, I think I will need spend about day to integrate algorithms of
Valentina 1.x for this. Then you will be able finish it.
Actually I thin we will start from you:
    you make high level calls, this will show us what
    I need to make for you.


--------
P.S. We with Ivan have made joins working yesterday!
    Today we going to make working Methods on join table.
    it seems we have idea to how make working effectively even such query

    SELECT T1.a1 + T2.b1
    FROM T1, T2
        
I.e. When expression in the SELECT clause is based on fields from different
tables.

Igor, we have add yesterday a new class Record_Join.
You need add it into Visual project.

And we have move into this class the loop that was in your
Table_Join::ReadRecord().


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina-beta mailing list