
April 6th, 2004, 05:17 AM
|
|
Registered User
|
|
Join Date: Apr 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
select count of 2 events from same column
I am trying to create a query which will return a count of Ys and Ns from one of the columns.
The following statement will return all the Ys but I want a third column to show the Ns.
SELECT DISTINCT a.name, COUNT(b.response)
FROM a,b
where a.id=b.id
AND b.response='Y'
GROUP BY a.name;
How can I modify this query to include a third column with a count of b.response where b.response='N'
Any help would be greatly appreciated.
|