Search Postgresql Archives

Migration from DB2 to PostgreSQL-ROLLUP()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux