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

Query question: grouping items

Status
Not open for further replies.
Nov 29, 2002
64
0
0
US
Hello there, I can't figure it out how to get this result:

I have a table with the following values:

GROUP PRODUCT
1 A
1 B
2 A
2 A
3 B
3 C
4 A
4 C
...

That is, x groups that with two products out of three available. The groups can have two products of the same or different kinds.

I'm trying to get the number of groups with:

(1) 2 products A
(2) 2 B
(3) 2 C
(4) 1 A + 1 B
(5) 1 A + 1 C
(6) 1 B + 1 C

Any ideas???

Cheers,
Alfredo
 
Check the forums and FAQs for cross tab queries.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top