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
  #41  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 9: SQL: count() - 07-31-2008 , 10:49 AM






Gene Wirchenko wrote:
Quote:
"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.
You're welcome. As Bernhard posts, there are other ways.

One of the great things about VFP is there are always 3 ways to do any given
thing. One of the worst things about VFP is there are always 3 ways to do
any given thing. <g>

Dan






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

Default Re: VFP 9: SQL: count() - 07-31-2008 , 10:49 AM






Gene Wirchenko wrote:
Quote:
"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.
You're welcome. As Bernhard posts, there are other ways.

One of the great things about VFP is there are always 3 ways to do any given
thing. One of the worst things about VFP is there are always 3 ways to do
any given thing. <g>

Dan




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

Default Re: VFP 9: SQL: count() - 07-31-2008 , 10:49 AM



Gene Wirchenko wrote:
Quote:
"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.
You're welcome. As Bernhard posts, there are other ways.

One of the great things about VFP is there are always 3 ways to do any given
thing. One of the worst things about VFP is there are always 3 ways to do
any given thing. <g>

Dan




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

Default Re: VFP 9: SQL: count() - 07-31-2008 , 10:49 AM



Gene Wirchenko wrote:
Quote:
"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.
You're welcome. As Bernhard posts, there are other ways.

One of the great things about VFP is there are always 3 ways to do any given
thing. One of the worst things about VFP is there are always 3 ways to do
any given thing. <g>

Dan




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

Default Re: VFP 9: SQL: count() - 07-31-2008 , 10:49 AM



Gene Wirchenko wrote:
Quote:
"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.
You're welcome. As Bernhard posts, there are other ways.

One of the great things about VFP is there are always 3 ways to do any given
thing. One of the worst things about VFP is there are always 3 ways to do
any given thing. <g>

Dan




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

Default Re: VFP 9: SQL: count() - 07-31-2008 , 10:49 AM



Gene Wirchenko wrote:
Quote:
"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.
You're welcome. As Bernhard posts, there are other ways.

One of the great things about VFP is there are always 3 ways to do any given
thing. One of the worst things about VFP is there are always 3 ways to do
any given thing. <g>

Dan




Reply With Quote
  #47  
Old   
Gene Wirchenko
 
Posts: n/a

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



Bernhard Sander <fuchs (AT) no (DOT) spam> 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.

SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode)
I tried this one before posting: Syntax error. I thought it
would work, too. Does anyone know what is wrong with it?

Quote:
or

SELECT Count(DISTINCT clcode) FROM yourTable
Sincerely,

Gene Wirchenko

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


Reply With Quote
  #48  
Old   
Gene Wirchenko
 
Posts: n/a

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



Bernhard Sander <fuchs (AT) no (DOT) spam> 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.

SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode)
I tried this one before posting: Syntax error. I thought it
would work, too. Does anyone know what is wrong with it?

Quote:
or

SELECT Count(DISTINCT clcode) FROM yourTable
Sincerely,

Gene Wirchenko

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


Reply With Quote
  #49  
Old   
Gene Wirchenko
 
Posts: n/a

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



Bernhard Sander <fuchs (AT) no (DOT) spam> 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.

SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode)
I tried this one before posting: Syntax error. I thought it
would work, too. Does anyone know what is wrong with it?

Quote:
or

SELECT Count(DISTINCT clcode) FROM yourTable
Sincerely,

Gene Wirchenko

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


Reply With Quote
  #50  
Old   
Gene Wirchenko
 
Posts: n/a

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






Bernhard Sander <fuchs (AT) no (DOT) spam> 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.

SELECT count(*) FROM (SELECT clcode FROM yourTable GROUP BY clCode)
I tried this one before posting: Syntax error. I thought it
would work, too. Does anyone know what is wrong with it?

Quote:
or

SELECT Count(DISTINCT clcode) FROM yourTable
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 - 2014, Jelsoft Enterprises Ltd.