Thanks for the tip. Regards Nafees On Thu, Apr 15, 2010 at 04:27:55AM -0700, Nafees Ur Rehman wrote:
Hi,
Whats is the syntax of grouping sets in monetdb? I am trying Select has_nurs,form,health,class,count(*) from nursery group by GROUPING SETS ((has_nurs,class),(form,class),(health,class)) but it does not work
As far as I know, MonetDB does not support "GROUPING SETS" (yet?). Hence, you'd have to rewrite your query to "UNION ALL" several queries that do the individual groupings; e.g., your example: SELECT has_nurs,form,health,class,count(*) FROM nursery GROUP BY GROUPING SETS ((has_nurs,class),(form,class),(health,class)) as follows: SELECT has_nurs,form,health,class,count(*) FROM nursery GROPU BY has_nurs,class UNION ALL SELECT has_nurs,form,health,class,count(*) FROM nursery GROPU BY form,class UNION ALL SELECT has_nurs,form,health,class,count(*) FROM nursery GROPU BY health,class; Feel free to file a feature request in case you would like to see "GROUPING SETS" in some future release of MonetDB/SQL (tough I cannot make any promises right now ...)
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
-- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4199 | ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users