Re: COUNT(DISTINCT some_column)
Oops...apologies...my mistake =) *blush* P On Fri, 23 Feb 2001, Fred van Engen wrote: > On Fri, Feb 23, 2001 at 08:13:20PM +0900, Sam Joseph wrote: > > > > however on the MySQL versions I currently have access to (3.22.32 & > > 3.22.34) I get this: > > > > mysql> select COUNT(DISTINCT SOME_COLUMN) from SOME_TABLE; > > ERROR 1064: You have an error in your SQL syntax near 'DISTINCT > > SOME_COLUMN) from SOME_TABLE' at line 1 > > > > > > I am assuming that either this function is not available or that it is a > > > > bug that has been fixed in a later release (or is on a todo list > > somewhere). > > > > It is a new feature of 3.23.xx. It wasn't supported in 3.22.x and not > described in the 3.22.x manual either. > > You'll need to upgrade to 3.23.x if you really want it. You can try > to use a SELECT COUNT(*) FROM SOME_TABLE GROUP BY SOME_COLUMN. > > > Regards, > > Fred. > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: COUNT(DISTINCT some_column)
On Fri, Feb 23, 2001 at 08:13:20PM +0900, Sam Joseph wrote: > > however on the MySQL versions I currently have access to (3.22.32 & > 3.22.34) I get this: > > mysql> select COUNT(DISTINCT SOME_COLUMN) from SOME_TABLE; > ERROR 1064: You have an error in your SQL syntax near 'DISTINCT > SOME_COLUMN) from SOME_TABLE' at line 1 > > I am assuming that either this function is not available or that it is a > > bug that has been fixed in a later release (or is on a todo list > somewhere). > It is a new feature of 3.23.xx. It wasn't supported in 3.22.x and not described in the 3.22.x manual either. You'll need to upgrade to 3.23.x if you really want it. You can try to use a SELECT COUNT(*) FROM SOME_TABLE GROUP BY SOME_COLUMN. Regards, Fred. -- Fred van Engen XO Communications B.V. email: [EMAIL PROTECTED] Televisieweg 2 tel: +31 36 5462400 1322 AC Almere fax: +31 36 5462424 The Netherlands - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: COUNT(DISTINCT some_column)
This feature isn't available in current versions of mySQL, but is on the TODO list. regards, P On Fri, 23 Feb 2001, Sam Joseph wrote: > Hi there, > > Doesn't seem to be a FAQ so here goes with a question > > My MySQL manual has the following to say about how to count the number > of distinct values in a particular column > > COUNT(DISTINCT expr,[expr...]) > Returns a count of the number of different values. > mysql> select COUNT(DISTINCT results) from student; > > however on the MySQL versions I currently have access to (3.22.32 & > 3.22.34) I get this: > > mysql> select COUNT(DISTINCT SOME_COLUMN) from SOME_TABLE; > ERROR 1064: You have an error in your SQL syntax near 'DISTINCT > SOME_COLUMN) from SOME_TABLE' at line 1 > > whereas > > mysql> select COUNT(SOME_COLUMN) from SOME_TABLE; > > works fine > > I am assuming that either this function is not available or that it is a > > bug that has been fixed in a later release (or is on a todo list > somewhere). > > Can anybody fill me in? > > Thanks in advance > > CHEERS> SAM > > > - > Before posting, please check: >http://www.mysql.com/manual.php (the manual) >http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
COUNT(DISTINCT some_column)
Hi there, Doesn't seem to be a FAQ so here goes with a question My MySQL manual has the following to say about how to count the number of distinct values in a particular column COUNT(DISTINCT expr,[expr...]) Returns a count of the number of different values. mysql> select COUNT(DISTINCT results) from student; however on the MySQL versions I currently have access to (3.22.32 & 3.22.34) I get this: mysql> select COUNT(DISTINCT SOME_COLUMN) from SOME_TABLE; ERROR 1064: You have an error in your SQL syntax near 'DISTINCT SOME_COLUMN) from SOME_TABLE' at line 1 whereas mysql> select COUNT(SOME_COLUMN) from SOME_TABLE; works fine I am assuming that either this function is not available or that it is a bug that has been fixed in a later release (or is on a todo list somewhere). Can anybody fill me in? Thanks in advance CHEERS> SAM - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php