Migration from DB2 to PostgreSQL-ROLLUP()

From: sachin kotwal <kotsachin(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Migration from DB2 to PostgreSQL-ROLLUP()
Date: 2013-06-19 08:56:23
Message-ID: 1371632182881-5759825.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

While migrating my application from DB2 to PostgreSQL.

I want to migrate ROLLUP() function in PostgreSQL.

Example:
SELECT WEEK(SALES_DATE) AS WEEK,
DAYOFWEEK(SALES_DATE) AS DAY_WEEK,
SUM(SALES) AS UNITS_SOLD
FROM SALES
GROUP BY ROLLUP ( WEEK(SALES_DATE), DAYOFWEEK(SALES_DATE) )
ORDER BY WEEK, DAY_WEEK

This example shows two simple ROLLUP queries followed by a query which
treats the two ROLLUPs as grouping sets in a single result set and specifies
row ordering for each column involved in the grouping sets.

How can I migrate ROLLUP() function in PostgreSQL? or is there any similar
function in PostgreSQL which can done this job?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Migration-from-DB2-to-PostgreSQL-ROLLUP-tp5759825.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2013-06-19 09:00:52 Re: Migration from DB2 to PostgreSQL
Previous Message sachin kotwal 2013-06-19 08:24:30 Migration from DB2 to PostgreSQL