ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baresel, Christoph" <Christoph.Bare...@de.soliver.com>
Subject Summation in more than one group levels
Date Tue, 24 Oct 2006 09:13:41 GMT
I want to get a summation for some fields in a result-set
over more than one group level. I have no Olap-Functions on the
DB-Server ( iSeries V5R3 ),
so I have to do it with Java. 

Is there a possibility to do it with ibatis-SQL-Map?

e.g.: 
select sum(pieces), company, customer  from mytable group by
company, customer
order by company, customer

I want to get a list with Objects from Ibatis with the following data:
 pieces     CompanyId     customerId     isSum
        1	    	A		1	no
        1	    	A		1	no
        1	    	A		1	no
        3    	A		1	yes

        1	    	A		2	no
        1		A		2	no
        2		A             	2	yes

        5		A             		yes


        1	    	B		1	no
        1	    	B		1	no
        1	    	B		1	no
        3    	B		1	yes

        1	    	B		2	no
        1		B		2	no
        2		B             	2	yes

        5		B             		yes

Any idea??

Christoph 

Mime
View raw message