Re: Count Issues

Поиск
Список
Период
Сортировка
Искать

Re: Count Issues

От:
Steven Klassen <sklassen@commandprompt.com>
Дата:
* Dev  [2004-10-14 16:54:56 -0400]:

> I am trying to get a total number of rows returned form a query.
> 
> SELECT count(this) from table group by this

Remove the 'group by' clause -- you don't need it.

-- 
Steven Klassen - Lead Programmer
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Replication & Support Services, (503) 667-4564

Re: Count Issues

От:
Andre Maasikas <andre.maasikas@abs.ee>
Дата:
Dev wrote:

> Hello all,
> 
> I am trying to get a total number of rows returned form a query.
> 
> SELECT count(this) from table group by this
> 
> Currently it is returning x rows  with a count of each of the group by.
> 
> I need the count of the rows returned!
> 
SELECT COUNT(DISTINCT this) FROM table

Andre

Re: Count Issues

От:
John Sidney-Woollett <johnsw@wardbrook.com>
Дата:
How about ...

select count(distinct this) from table

John Sidney-Woollett

Dev wrote:
> 
> Hello all,
> 
> I am trying to get a total number of rows returned form a query.
> 
> SELECT count(this) from table group by this
> 
> Currently it is returning x rows  with a count of each of the group by.
> 
> I need the count of the rows returned!
> 
> Any way to do this?
> 
> 
> 
> ----------
> 
> UMPA
>   Brian C. Doyle
> Director, Internet Services
> United Merchant Processing Association
> http://www.umpa-us.com
> 1-800-555-9665 ext 212
> 

Count Issues

От:
Dev <dev@umpa-us.com>
Дата:
Hello all,

I am trying to get a total number of rows returned form a query.

SELECT count(this) from table group by this

Currently it is returning x rows  with a count of each of the group by.

I need the count of the rows returned!

Any way to do this?



 Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212

Re: Count Issues

От:
Dev <dev@umpa-us.com>
Дата:
Thank you all who helped me out on this..
I had tried the distinct but not inside the count.
I was using the group by because this could have multiple returns but after adding the distinct to inside the count it worked like a charm!!!

Thanks to everyone who helped out on this one!


At 05:01 PM 10/14/2004, Dev wrote:
Hello all,

I am trying to get a total number of rows returned form a query.

SELECT count(this) from table group by this

Currently it is returning x rows  with a count of each of the group by.

I need the count of the rows returned!

Any way to do this?



  Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212



 Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212

R: Count Issues

От:
"Luciano Bastianello " <lucianobastianello@yahoo.it>
Дата:
 
SELECT COUNT(*) from mytable 

-------------------------------------------
Bastianello Luciano 
Software Consultant - Apprentice Sorcerer
e-mail: lbastianello@virgilio.it 
e-mail: lbastianello@yahoo.it
ICQ: 209754422 - MSN: cteniza@hotmail.com
------------------------------------------- 

FAQ