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 Regards Nafees Ur Rehman
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Op 15-04-10 13:27, Nafees Ur Rehman schreef:
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
It does not seem to be defined in SQL92 http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt, thus it is not (yet) supported. Probably the best thing to do is to add a feature request on Sourceforge for it. Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEAREKAAYFAkvG+UIACgkQYH1+F2Rqwn31ZQCfSDtyCIemTtoGhK7l0JrpueUg YbgAnjwB/1FCJCymKzik1gLlQnfqcOA0 =/igd -----END PGP SIGNATURE-----
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 ...) Stefan
Regards Nafees Ur Rehman
------------------------------------------------------------------------------ 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 |
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
participants (3)
-
Nafees Ur Rehman
-
Stefan de Konink
-
Stefan Manegold