Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2008-02-15 : 06:06:52
|
| hi,how can I show my customers that only have 1 product.I thought I could do this :Select personid from productgroup by personidhaving count(personid) = 1 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-02-15 : 06:08:35
|
| [code]Select PersonID from Productgroup by PersonIDhaving min(ProductID) = Max(ProductID)[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2008-02-15 : 06:14:07
|
| thank you, but how can I then do cutomers with 2 products.. or 3 products, etc ? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-15 : 06:21:19
|
Select PersonID from Productgroup by PersonIDhaving count(distinct ProductID) = 2..3..4 E 12°55'05.25"N 56°04'39.16" |
 |
|
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2008-02-15 : 06:41:24
|
| thank you, Thats perfect. |
 |
|
|
|
|
|