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
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
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
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
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
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
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
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
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
]
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
* 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
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
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
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
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
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
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
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
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
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() 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
[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
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
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
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
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
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
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
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
31 matches
Mail list logo