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 |
|
whitebird
Starting Member
12 Posts |
Posted - 2008-01-21 : 08:40:38
|
| Hi, I have a sql result like this. SalesPersonId , ProductId. 1 10 1 10 1 11 1 12 2 10 2 11 3 10 3 10i want the sql query to display output like this. 1 3 2 2 3 1Please give me the sql query as soon as possible.Regards,WhitebirdRaghu sunkara, |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-01-21 : 08:54:48
|
| [code]Select SalesPersonID, count(distinct ProductID) as Prod_CountFrom TableGroup by SalesPersonID[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-01-26 : 12:27:57
|
quote: Pease give me the sql query as soon as possible.
in the middle of an exam, whitebird? Be One with the OptimizerTG |
 |
|
|
|
|
|