ys. :-) )
I'm not saying that this is the book that you should get. But if
you want to increase your SQL knowledge, you should look into getting
something.
Cheers,
Richard
> From: "Jamie Burns" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, Sept
Use the DISTINCT keyword and count the returned rows
- Original Message -
From: "Jamie Burns" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 9:08 AM
Subject: surely an easy quick one
> Hello again :o)
>
> This is surely an e
Woops! Nevermind. I didn't notice your data was denormalized.
- Original Message -
From: "Chris Johnson" <[EMAIL PROTECTED]>
To: "Jamie Burns" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 10:33 PM
Subject: Re: sur
If you want a count for a specific team:
Select count(*) From table Where team = 'support';
If you want the counts for all the teams:
Select team, count(*) From table Group By team;
- Original Message -
From: "Jamie Burns" <[EMAIL PROTECTED]>
I have a table (ref, name, team, seminar_r
O.k, how about this query.
SELECT DISTINCT name,count(1) AS numPeople FROM tester Where team
='support'
GROUP BY team
Its a bit dirty and it returns an extra column, but this could be ignored
--
Colin
-
Before posting,
Hi,
> SELECT COUNT(DISTINCT name) from tester WHERE team = 'support'
Could 2 queries do the trick?
insert into temptable
select count(name) from tester
where team = 'support'
group by team;
select count(*) from temptable;
Best Regards,
Sasa
P.S. create table temptable(tempfield integ
Please ignore my last post. I had lost track of what you were trying to
achieve with your query.
--
Colin
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/
;; <[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 9:56 AM
Subject: Re: surely an easy quick one
> this doesnt work as i need either :o(
>
> it returns 3 rows, each with a count of 3 inside. i just want to get a
> *single row* with the number 3 in it (for my example).
>
>>
> this doesnt work as i need either :o(
>
> it returns 3 rows, each with a count of 3 inside. i just want to get a
> *single row* with the number 3 in it (for my example).
>
>
You just need to add another clause to the where statement
> > SELECT COUNT(*) FROM table WHERE team = "support" AN
:o)
Jamie.
- Original Message -
From: "Lezz Giles" <[EMAIL PROTECTED]>
To: "Jamie Burns" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 2:29 PM
Subject: Re: surely an easy quick one
> I haven't tested this; I'm not an SQL
;Jamie Burns" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 2:29 PM
Subject: Re: surely an easy quick one
> I haven't tested this; I'm not an SQL guru. I just
> like a challenge :-)
>
> SELECT COUNT(*) FROM table WHERE team = "
Hi,
idname group_name
--
> 1bill support 100
> 2bill support 101
> 3bill support 102
> 4bendevelopment 201
> 5bendevelopment 103
> 6bendevelopment 204
> 7bobs
times (this is where your query
gets 9 from).
:o(
- Original Message -
From: "Stefan Pinkert" <[EMAIL PROTECTED]>
To: "Jamie Burns" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 2:25 PM
Subject: Re: surely an easy quick one
>
> select count(*) from table where team='support' group by team
>
>
I think that should be a group by name not by team.
--
Colin
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http:
Friday, September 14, 2001 9:08 AM
Subject: surely an easy quick one
> Hello again :o)
>
> This is surely an easy quick one but my brain wont work!
>
> I have a table (ref, name, team, seminar_ref) like:
>
> 1billsupport100
> 2billsupport101
select count(*) from table where team='support' group by team
-Ursprüngliche Nachricht-
Von: Jamie Burns [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 14. September 2001 15:09
An: [EMAIL PROTECTED]
Betreff: surely an easy quick one
Hello again :o)
This is surely an easy qui
Hello again :o)
This is surely an easy quick one but my brain wont work!
I have a table (ref, name, team, seminar_ref) like:
1billsupport100
2billsupport101
3billsupport102
4ben development 201
5ben development 103
6
17 matches
Mail list logo