COUNT(DISTINCT R1,R2) within an IF statement?

2005-04-17 Thread Dan Bolser
Hi, I have a query which looks like this... SELECT BLEAH, COUNT(DISTINCT R1,R2) FROM T1 WHERE FK = 1 GROUP BY BLEAH ; Lets say that over 10 rows where FK = 1 it counts 5 distinct R1-R2 pairs in a single 'BLEAH' group BLEAH = 'Y'. Now I want to search the table f

Query: count(distinct field1… max(fieldn)) where…?

2004-03-18 Thread Victor Spång Arthursson
BY titel  Earlier, before I added the max(datum) to the query, i could get the number of rows by doing: --- SQL --- SELECT count( DISTINCT film_film.filmid, titel, IF ( aar IS NULL , '', aar ), IF ( termin IS NULL , '', termin ) ) AS antal FROM ( ( ( `f

Re: COUNT(DISTINCT ...)

2003-03-12 Thread Paul DuBois
At 16:42 -0500 3/12/03, Bob Sawyer wrote: HELP! I'm getting the following error: -- Error (SQL): SELECT date, subject, location, private, id, duration, dategroup_id, COUNT(DISTINCT subject) AS appointment_count, inituserid FROM mgw_calendar WHERE userid=1 AND SUBSTRING(dat

COUNT(DISTINCT ...)

2003-03-12 Thread Bob Sawyer
HELP! I'm getting the following error: -- Error (SQL): SELECT date, subject, location, private, id, duration, dategroup_id, COUNT(DISTINCT subject) AS appointment_count, inituserid FROM mgw_calendar WHERE userid=1 AND SUBSTRING(date,1,8) = '20030312' GROUP BY date, su

strange NULL in result, "if(count(distinct...))" and "order by"

2002-04-03 Thread Andrew Shirrayev
>Description: 3 "select" with little difference (2 with strange result, and last correct) == select Schedule.PTRScheme as Scheme_ID, Subject.TID as Subject_TID, Scheme.PTRSubject as Subject_ID, if(c

RE: select count distinct

2002-02-13 Thread Land, Christopher
ation by using an alias for the expression: mysql> SELECT id,FLOOR(value/100) AS val FROM tbl_name GROUP BY id,val ORDER BY val; C: -Original Message- From: Brian Warn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:31 PM To: MySQL List Subject: select count

select count distinct

2002-02-13 Thread Brian Warn
I'm stuck right now with using v. 3.22.32. Yes, I know I need to upgrade, but I can't for various reasons. Anyway, I need to do a select count(distinct column) from table query, but can't since this version doesn't support it. How can I do

bug in count(distinct(putafieldnamehere)) ?

2002-02-12 Thread Maverick
Hi, can it be that there is a bug in count(distinct(putafieldnamehere)) ? After restarting the server it runs, but after some time it doesnt return any result-rows. A count(putafieldnamehere) runs without problems in this situation. Thanx for any sugesstions to solve this problem ... mysql

AW: bug in count(distinct(putafieldnamehere)) ?

2002-02-11 Thread Maverick
Ok, its not in count(distinct()). It always happends if temptables are used, but only if the server runs some minutes/hours/days :( -Ursprüngliche Nachricht- Von: Maverick [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 7. Februar 2002 16:48 An: [EMAIL PROTECTED] Betreff: bug in count

AW: bug in count(distinct(putafieldnamehere)) ?

2002-02-07 Thread Maverick
Ok, its not in count(distinct()). It always happends if temptables are used, but only if the server runs some minutes/hours/days :( -Ursprüngliche Nachricht- Von: Maverick [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 7. Februar 2002 16:48 An: [EMAIL PROTECTED] Betreff: bug in count

bug in count(distinct(putafieldnamehere)) ?

2002-02-07 Thread Maverick
Hi, can it be that there is a bug in count(distinct(putafieldnamehere)) ? After restarting the server it runs, but after some time it doesnt return any result-rows. A count(putafieldnamehere) runs without problems in this situation. Thanx for any sugesstions to solve this problem ... mysql

RE: count(distinct

2002-01-09 Thread Roger Baklund
COUNT(DISTINCT was introduced in 3.23.2: http://www.mysql.com/doc/N/e/News-3.23.2.html > -- Roger - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (

RE: count(distinct

2002-01-09 Thread Land, Christopher
Same here: F:\MySQL\bin>mysql -uroot -e "select count(distinct Host) from user \G" mysql *** 1. row ******* count(distinct Host): 2 F:\MySQL\bin>mysql -v Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connec

Re: count(distinct

2002-01-09 Thread Stephen Abshire
I am inclined to think (actually guess) it may be the version of MySQL you are using. I am using MySQL 3.23.39 and I am able to successfully execute: select count(distinct field) or select count(distinct(field)) I tried to make a quick check of the docs to see if a certain version was

RE: count(distinct

2002-01-09 Thread Roger Baklund
* Ilic > >>SELECT count(distinct ip) FROM pole_voti > >> > >>It does'nt work. Why ? > >> > >>PhpMyAdmin says: You have an error in your SQL syntax near > >>'distinct ip) FROM pole_voti' at line 1 > > >I don't have

RE: count(distinct

2002-01-09 Thread Land, Christopher
AM To: [EMAIL PROTECTED] Subject: Re: count(distinct Il Tue, 08 Jan 2002 13:23:09 -0500, Stephen Abshire andava dicendo... >>SELECT count(distinct ip) FROM pole_voti >> >>It does'nt work. Why ? >> >>PhpMyAdmin says: You have an error in your SQL syntax near >&g

Re: count(distinct

2002-01-09 Thread Ilic
Il Tue, 08 Jan 2002 13:23:09 -0500, Stephen Abshire andava dicendo... >>SELECT count(distinct ip) FROM pole_voti >> >>It does'nt work. Why ? >> >>PhpMyAdmin says: You have an error in your SQL syntax near >>'distinct ip) >>FROM pole_voti'

Re: count(distinct

2002-01-08 Thread Carl Troein
Ilic writes: > SELECT count(distinct ip) FROM pole_voti > > It does'nt work. Why ? What's your MySQL version? Check the docs to see what version is required for count(distinct). I think it was added in 3.23.early, so it might be time to upgrade. //C -- Carl Troei

RE: count(distinct

2002-01-08 Thread Land, Christopher
The syntax is: SELECT DISTINCT http://www.mysql.com/doc/S/E/SELECT.html Xi2 -Original Message- From: Ilic [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 08, 2002 9:48 AM To: [EMAIL PROTECTED] Subject: count(distinct SELECT count(distinct ip) FROM pole_voti It does'nt work

Re: count(distinct

2002-01-08 Thread Stephen Abshire
I don't have MySQL on the computer I am on to test this but you might try rewriting it this way: select count(distinct(ip)) from pole_voit Original Message Follows From: Ilic <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: count(distinct Date: Tue, 8 Jan 20

count(distinct

2002-01-08 Thread Ilic
SELECT count(distinct ip) FROM pole_voti It does'nt work. Why ? PhpMyAdmin says: You have an error in your SQL syntax near 'distinct ip) FROM pole_voti' at line 1 Why ? Where is the error ? Ilic. - Before

any bugs with 3.23.36 regarding COUNT(DISTINCT ?

2001-10-18 Thread Kevin Fries
Hi, we're trying to recommend that clients upgrade to version 3.23.36, and wanted to ensure that it's stable. Particularly, have there been any bugs regarding any bugs regarding the use of COUNT(DISTINCT since then? In other words, if our software performs a COUNT(DISTINCT co

COUNT(DISTINCT) -- is this correct behaviour?

2001-06-19 Thread Michael Widenius
Hi! Thanks for the nice test case! Next time you have as nice a test case, please send it to [EMAIL PROTECTED] for fast treatment! >>>>> "tommie" == tommie <[EMAIL PROTECTED]> writes: tommie> count() gives 0 but count(distinct) gives 1. is this cor

Re: COUNT(DISTINCT) -- is this correct behaviour?

2001-06-16 Thread Sinisa Milivojevic
[EMAIL PROTECTED] writes: > count() gives 0 but count(distinct) gives 1. is this correct or > a bug or is there something wrong with my SELECT? > > mysql> create table t1 (f1 int); > mysql> insert into t1 values (1); > mysql> create table t2 (f1 int,f2 int); > m

COUNT(DISTINCT) -- is this correct behaviour?

2001-06-16 Thread tommie
count() gives 0 but count(distinct) gives 1. is this correct or a bug or is there something wrong with my SELECT? mysql> create table t1 (f1 int); mysql> insert into t1 values (1); mysql> create table t2 (f1 int,f2 int); mysql> select t1.f1,count(t2.f2) from t1 -> left join

Re: count distinct

2001-04-13 Thread Peter Pentchev
On Fri, Apr 13, 2001 at 12:37:40PM +0200, Z_da_eXTaZie wrote: > I can make this query: select a from table. > I can count it: select count(a) from table. > I can select it: select distinct a from table. > But how can i count it? > > select count(distinct a) from table doesn

count distinct

2001-04-13 Thread Z_da_eXTaZie
I can make this query: select a from table. I can count it: select count(a) from table. I can select it: select distinct a from table. But how can i count it? select count(distinct a) from table doesn't works Z - B

Re: select(count(distinct(status))

2001-04-06 Thread Peter Skipworth
It should work fine as printed...but you'll need mysql 3.23.xx On Fri, 6 Apr 2001, Temeschinko, Michael wrote: > > hi, > > I need to make a select like above in the subject count distinct (I need the > count of the different values of a coloumn) > > Hope you g

select(count(distinct(status))

2001-04-06 Thread Temeschinko, Michael
hi, I need to make a select like above in the subject count distinct (I need the count of the different values of a coloumn) Hope you guys won't let me die silly! :-) greetings from germany Micha -- A train station is a station where a train stops But what the hell is a workst

Re: COUNT(DISTINCT some_column)

2001-02-23 Thread Peter Skipworth
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: > > &

Re: COUNT(DISTINCT some_column)

2001-02-23 Thread Fred van Engen
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

Re: COUNT(DISTINCT some_column)

2001-02-23 Thread Peter Skipworth
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

COUNT(DISTINCT some_column)

2001-02-23 Thread Sam Joseph
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

RE: COUNT(DISTINCT )

2001-02-16 Thread Roger Ramirez
You can use: SELECT , count() FROM GROUP BY > -Original Message- > From: Franz, Fa. PostDirekt MA [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 3:02 AM > To: [EMAIL PROTECTED] > Subject: COUNT(DISTINCT ) > > > > Hi Everybody , > > I am u

RE: COUNT(DISTINCT )

2001-02-16 Thread Carsten H. Pedersen
COUNT(DISTINCT...) wasn't added until v. 3.23.02 / Carsten -- Carsten H. Pedersen keeper and maintainer of the bitbybit.dk MySQL FAQ http://www.bitbybit.dk/mysqlfaq > Hi Everybody , > > I am using MySql 3.22.32 on LINUX. > My problem is , that 'SELECT COUNT(DISTINCT ) F

COUNT(DISTINCT )

2001-02-16 Thread Franz, Fa. PostDirekt MA
Hi Everybody , I am using MySql 3.22.32 on LINUX. My problem is , that 'SELECT COUNT(DISTINCT ) FROM doesn't work like described in the HTML-manual (7.4.13) . It even doesn't work at all. Is tthat a bug , am I stupid , or is there any workaround. Greetings

Re: Problem using COUNT & DISTINCT together

2001-02-05 Thread Gerald L. Clark
Check the docs to see when count distinct() was added. It is not in my 3.22.24, but is in my 3.23 Web Depressed wrote: > > Hi, > Woh ! This is very strange. Any ideas ? > > mysql> SELECT * FROM Table2; > ++-+---+ > | date |

Problem using COUNT & DISTINCT together

2001-02-05 Thread Web Depressed
row in set (0.02 sec) mysql> SELECT DISTINCT date FROM Table2; ++ | date | ++ | 2001-02-04 | | 2001-02-05 | | 2001-02-06 | ++ 3 rows in set (0.03 sec) mysql> SELECT COUNT(DISTINCT date) FROM Table2; ERROR 1064: You have an error in your SQL syntax ne