Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Count Problems

Status
Not open for further replies.

monsjic

Programmer
Jan 23, 2002
23
US
Here is the question with the right information.
Sorry about the confusion.
I have data like below:
[tt]
Table1 Table2
Fld1: Fld2: Fld3: FldA: FldB: FldC:
1 A 1 1 A 1
2 B 2 2 A 1
3 B 3 3 A 4
4 C 5 4 B 3
5 A 1
6 C 5
7 C 5

I run the SQL below and get the output below it.

SELECT Fld2, Fld3, Count('x') AS COUNT
FROM Table1, Table2
WHERE Fld3=FldC AND Fld2=FldB
GROUP BY Fld2, Fld3;

RESULTS FOR COUNT
DESIRED
Fld2: Fld3: Count: COUNT:
A 1 3 1
B 3 1 1
C 5 2 1


Does anyone know how to get my desired counts?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top