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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query question

Status
Not open for further replies.

nxm150

Programmer
May 22, 2002
78
0
0
US
SELECT COUNT(*)
FROM TABLE1 B,
TABLE2 A
WHERE B.FIELD1 = 44441 AND B.FIELD2 = A.FIELD2
GROUP BY A.FIELD3

This query is pulling back the following info currently -

12
27
46
1
2
1
2

I want to pull back the value in field 3 also...but am coming up blank on how to code this. Any help would be appreciated.

12 A
27 B
46 C
1 D
2 E
1 F
2 G
 
Hi,
How about:

SELECT COUNT(*), A.FIELD3
FROM TABLE1 B,
TABLE2 A
WHERE B.FIELD1 = 44441 AND B.FIELD2 = A.FIELD2
GROUP BY A.FIELD3

which should do the trick.
 
Simple enough. I will give it a try. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top