![]() | |
#41
| |||
| |||
|
|
"Dan Freeman" <spam (AT) microsoft (DOT) com> wrote: Select clcode Group by clcode ?_tally Blindsided again. I use _tally quite often, and I did not even think of doing this. Thank you. |
#42
| |||
| |||
|
|
"Dan Freeman" <spam (AT) microsoft (DOT) com> wrote: Select clcode Group by clcode ?_tally Blindsided again. I use _tally quite often, and I did not even think of doing this. Thank you. |
#43
| |||
| |||
|
|
"Dan Freeman" <spam (AT) microsoft (DOT) com> wrote: Select clcode Group by clcode ?_tally Blindsided again. I use _tally quite often, and I did not even think of doing this. Thank you. |
#44
| |||
| |||
|
|
"Dan Freeman" <spam (AT) microsoft (DOT) com> wrote: Select clcode Group by clcode ?_tally Blindsided again. I use _tally quite often, and I did not even think of doing this. Thank you. |
#45
| |||
| |||
|
|
"Dan Freeman" <spam (AT) microsoft (DOT) com> wrote: Select clcode Group by clcode ?_tally Blindsided again. I use _tally quite often, and I did not even think of doing this. Thank you. |
#46
| |||
| |||
|
|
"Dan Freeman" <spam (AT) microsoft (DOT) com> wrote: Select clcode Group by clcode ?_tally Blindsided again. I use _tally quite often, and I did not even think of doing this. Thank you. |
#47
| |||
| |||
|
|
How do I, in one query, get the count of the number of distinct values for a particular column? For example: clcode other ------ ----- ABC 12 ABC 34 DEF 17 DEF 21 DEF 58 GHI 29 The result that I want is the number of different clcode values in the above: 3. I thought I had done this before with but one query, but can not figure it out now. SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode) |
|
or SELECT Count(DISTINCT clcode) FROM yourTable |
#48
| |||
| |||
|
|
How do I, in one query, get the count of the number of distinct values for a particular column? For example: clcode other ------ ----- ABC 12 ABC 34 DEF 17 DEF 21 DEF 58 GHI 29 The result that I want is the number of different clcode values in the above: 3. I thought I had done this before with but one query, but can not figure it out now. SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode) |
|
or SELECT Count(DISTINCT clcode) FROM yourTable |
#49
| |||
| |||
|
|
How do I, in one query, get the count of the number of distinct values for a particular column? For example: clcode other ------ ----- ABC 12 ABC 34 DEF 17 DEF 21 DEF 58 GHI 29 The result that I want is the number of different clcode values in the above: 3. I thought I had done this before with but one query, but can not figure it out now. SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode) |
|
or SELECT Count(DISTINCT clcode) FROM yourTable |
#50
| |||
| |||
|
|
How do I, in one query, get the count of the number of distinct values for a particular column? For example: clcode other ------ ----- ABC 12 ABC 34 DEF 17 DEF 21 DEF 58 GHI 29 The result that I want is the number of different clcode values in the above: 3. I thought I had done this before with but one query, but can not figure it out now. SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode) |
|
or SELECT Count(DISTINCT clcode) FROM yourTable |
![]() |
| Thread Tools | |
| Display Modes | |
| |