dbTalk Databases Forums  

VFP 9: SQL: count()

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP 9: SQL: count() in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default VFP 9: SQL: count() - 07-30-2008 , 04:41 PM






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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Reply With Quote
  #2  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM






Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #3  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #4  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #5  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #6  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #7  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #8  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #9  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #10  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-30-2008 , 05:07 PM



Select clcode Group by clcode
?_tally

Dan

Gene Wirchenko wrote:
Quote:
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.

Have I been bitten by a bitrot bug or something?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.