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 for all FK's

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 ( ( ( `film_film` LEFT JOIN

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, subject, location

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(date,1,8

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 this? Thanks, Brian

RE: select count distinct

2002-02-13 Thread Land, Christopher
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 distinct

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

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

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

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' at line 1 I don't have MySQL on the computer I am on to test

RE: count(distinct

2002-01-09 Thread Land, Christopher
] 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 'distinct ip) FROM pole_voti' at line 1 I don't have MySQL on the computer I

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 MySQL on the computer I am on to test this but you might try rewriting it this way: select count

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

RE: count(distinct

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

RE: count(distinct

2002-01-09 Thread Roger Baklund
COUNT(DISTINCT was introduced in 3.23.2: URL: 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

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 posting, please

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 2002 18:47:43 +0100 SELECT

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. Why

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 Troein - Círdan / Istari

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 column) FROM

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 correct or tommie a bug or is there something wrong

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 t2 on t1.f1=t2.f1

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); mysql select t1.f1,count(t2.f2) from t1

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 - Before

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't works It works for me

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 workstation

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 guys won't let me die silly

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 results

RE: COUNT(DISTINCT Column_Name)

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

Problem using COUNT DISTINCT together

2001-02-05 Thread Web Depressed
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 near 'DISTINCT