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
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
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
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
>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
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
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
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
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
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
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
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/ (
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
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
* 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
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
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'
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
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
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
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
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
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
[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() 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
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
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
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
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
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:
> >
&
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
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
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
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
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
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
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 |
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
38 matches
Mail list logo