Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
I want to make some statistic computing, but I cannot find any related topic in documentation or maillist. e.g. how can I implement the following statement(oracle 8i) in hsqldb?
select to_char(return_date,'MONTH'), name, sum(fee)
group by rollup(to_char(return_date,'MONTH'),name)
HSQLDB doesn't support ROLLUP.
You may be able to write a UNION which has the different rows and use another select with a GROUP BY clause around the UNION to order the results.
Would be nice to have rollup/cube options supported in HSQL. Any plans to add them?
There are no current plans. Perhaps next year or so.
Really wanted feature. I vote for it!
You can already do this
CREATE TABLE JOBS (CLIENTID INT, JOBTYPE INT, FEE DECIMAL(10,2))
INSERT INTO JOBS VALUES 11, 2, 12.40
INSERT INTO JOBS VALUES 11, 2, 11.10
INSERT INTO JOBS VALUES 11, 3, 2.10
INSERT INTO JOBS VALUES 13, 3, 2.10
INSERT INTO JOBS VALUES 13, 3, 1.10
WITH JOBSTATS(CLIENTID, JOBTYPE, FEE) AS (SELECT CLIENTID, JOBTYPE, SUM(FEE)
FROM JOBS GROUP BY CLIENTID, JOBTYPE)
SELECT CLIENTID, CAST(JOBTYPE AS VARCHAR(10)) AS JOBTYPE, FEE FROM JOBSTATS
SELECT CLIENTID, '', SUM(FEE) FROM JOBSTATS GROUP BY CLIENTID ORDER BY CLIENTID, JOBTYPE DESC
CLIENTID JOBTYPE FEE
-------- ------- -----
11 3 2.10
11 2 23.50
13 3 3.20