Re: help with count in grouped query

2008-01-10 Thread Perrin Harkins
On Jan 10, 2008 5:40 PM, Eben <[EMAIL PROTECTED]> wrote: > I want to be able to do count of the total records brought back by this > query... but since I am using the group by I can't use COUNT() in the > desired way. Assuming what you want is all the data from your current query plus an additiona

help with count in grouped query

2008-01-10 Thread Eben
I have this query: SELECT table.id,table.field_1,table.field_2,COUNT(table.field_1) as total FROM table WHERE MATCH table.field_1 AGAINST ('some text') GROUP BY table.field_1,table.field_2 which returns aggregate results like: 1, data..., data..., 3 2, data..., data..., 1 3, data..., data..., 5

Re: Query help with count and join on same table I think

2006-04-10 Thread Frank
2wsxdr5 wrote: > I have a table of people. Some of the people in this table are > related. You can find out who is related by comparing a familyID > number. I have a query to select a certain group of people from the > table and I want to also select anyone who is related to them, even > though

Re: Help with count(*)

2003-08-14 Thread Daniel Rossi
what ever happend to a unique primary key like userID ? >>> "gord barq" <[EMAIL PROTECTED]> 08/11/03 11:15am >>> I have a table I'm using for logging purposes with a schema like: create table results ( user varchar(255) ); Where user is not a unique field and I want to find out how

Re: Help with count(*)

2003-08-14 Thread Janice Wright
select count(distinct(user)) from results; Cheers, Jan -- Janice Wright Ingenta plc [EMAIL PROTECTED] Tel: +44 (0) 01865 799114 http://www.ingentaselect.com/ Sometime recently Daniel Rossi said: > what ever happend to a unique primary key like userID ? > > >>> "gord barq" <[EMAIL PROTECTED

Re: Help with count(*)

2003-08-14 Thread Tan Shao Yi
On Mon, 11 Aug 2003, gord barq wrote: > I have a table I'm using for logging purposes with a schema like: > > create table results ( > user varchar(255) > > ); > > Where user is not a unique field and I want to find out how many unique > users there are in the table. > > I want to do

RE: Help with count(*)

2003-08-11 Thread Jim Smith
> > what ever happend to a unique primary key like userID ? > User is not the primary key. This is a logging table so the primary key is likely to be a timestamp of some sort. Read the question. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:htt

Re: Help with count(*)

2003-08-10 Thread mos
At 08:15 PM 8/10/2003, you wrote: I have a table I'm using for logging purposes with a schema like: create table results ( user varchar(255) ); Where user is not a unique field and I want to find out how many unique users there are in the table. I want to do something like: select co

Help with count(*)

2003-08-10 Thread gord barq
I have a table I'm using for logging purposes with a schema like: create table results ( user varchar(255) ); Where user is not a unique field and I want to find out how many unique users there are in the table. I want to do something like: select count(count(*)) from results group b

Re: Newbie: Help with count

2002-04-27 Thread George Chelidze
you can use: select messagestate, count(*) from table where uid=1 group by messagestate; for uid=1, if you want to do the same for all users with one query you can use: select uid, messagestate, count(*) from table group by uid, messagestate; Regards, Ben Holness wrote: > Hi all, > > I hav

Newbie: Help with count

2002-04-27 Thread Ben Holness
Hi all, I have a table that has data that looks something like this (fixed font on): UserID MessageID MessageState 1 1 PENDING 1 2 PENDING 2 3 FAILED 3 4 DELIVERED 2