Microsoft
Software
Hardware
Network
Question : msql cout by group query
hi, i am struggling with a query...
i have a table..
id type way
1 RW 2
2 FF 3
3 RW 3
4 RW 2
5 RW 2
6 RW 1
7 RW 2
I am wanting to list each unique type/way pair(way could be any number) with the number of times it occurs, eg...the above would return...
type way count
RW 1 1
RW 2 4
RW 3 1
FF 3 1
i know i can count one pair...
SELECT COUNT(type) AS the_type WHERE way='1' AND type ='RW'
i can then echo the_type with php, but how do i count and echo all type/way pairs
cheers
Answer : msql cout by group query
select distinct id, count(type), count(way) from Table
group by type, way;
Random Solutions
Quickr..How do I edit the tabs on the home page of my place? I want to add a tab
Using a query to filter a subreport?
unknown process - should I be concerned
Can I add multi-millions of records to SQL database while replication is on? Will it work?
How can I record two DV (firewire) inputs simultanously to a PC or Mac?
what is the best way to remove opachki.ru trojan?
To Blob Cache or NOT?
how to install certificate in SBS 2008
I am trying to load windows xp on a hp g71-340us laptop. The factory installed OS is windows 7 Home Premium. When the set-up disk is loading i get a Stop 0x0000007b BSOD.
VNC server Ubuntu 10.04