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 |
|
skativarapu
Starting Member
13 Posts |
Posted - 2006-07-18 : 16:17:05
|
| I have a table in which has 1300 rows and a colum has 800 unique values,100 twice repeated values and 100 3times repeated values.now i have added a new column which would have 1's and 0's 1 for each unique entery and 0 for every second or 3rd entery so that when i sum it up it should give 1000 -- SUM(column)=1000 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-07-18 : 16:28:42
|
quote: Originally posted by skativarapu now i have added a new column which would have 1's and 0's 1 for each unique entery and 0 for every second or 3rd entery
This u do for some purpose ? if so what is it?quote: Originally posted by skativarapuso that when i sum it up it should give 1000 -- SUM(column)=1000
What do u want to be done ?To find the # of unique values (ie. considering the repeated as 1) ?Srinika |
 |
|
|
skativarapu
Starting Member
13 Posts |
Posted - 2006-07-18 : 16:46:19
|
| consider the repeated as one so that that will give me the count of unique for my report in the warehouse to use that column in microstrategy for counting |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-07-18 : 17:01:02
|
If the sum is all you are after, you can get that without adding a column to the table.select count( distinct MyColumn )from MyTable CODO ERGO SUM |
 |
|
|
|
|
|