help with group by

2009-10-28 Thread Adam Williams
I've written a helpdesk ticket problem and am working on the statistics module. I'm having problems with group by. For instance, I want to get the count of the number of different problem types, by how many were solved by each person. This is my statement: mysql select distinct

Re: help with group by

2009-10-28 Thread Michael Dykman
try this: select accepted_by, problem_type, count(*) from form where problem_type is not NULL AND problem_type != 'Test' AND accepted_by is not null group by accepted_by, problem_type On Wed, Oct 28, 2009 at 12:05 PM, Adam Williams awill...@mdah.state.ms.us wrote: I've written a helpdesk

Re: help with group by

2009-10-28 Thread Adam Williams
works perfectly, i didn't know you could use multiple columns in the group by. thanks a bunch! Michael Dykman wrote: try this: select accepted_by, problem_type, count(*) from form where problem_type is not NULL AND problem_type != 'Test' AND accepted_by is not null group by accepted_by,

HELP!!!!! (JOIN, GROUP BY INDEX)

2004-01-26 Thread Hsiu-Hui Tseng
how come no one response to my email? thanks! My question is below: Hi, I have some question on JOIN and INDEX usage on GROUP BY. Hope you can help me. thanks! 1. If there is any performance differenct for join from a small table to a big table and join from a big table to a small table? 2. If

Re: need help with GROUP BY

2003-02-08 Thread Paul DuBois
At 9:24 -0600 2/5/03, Jaime Teng wrote: I have a MySQL table: ++--+--+-+-++ | Field | Type | Null | Key | Default | Extra | ++--+--+-+-++ | id

RE: need help with GROUP BY

2003-02-07 Thread Shapiro, David
DISTINCT? -Original Message- From: Tab Alleman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 12:31 PM To: Jaime Teng; [EMAIL PROTECTED] Subject: RE: need help with GROUP BY SELECT id,account FROM tablename WHERE detail LIKE '%pattern%' GROUP BY Account; -Original

RE: need help with GROUP BY

2003-02-06 Thread Tab Alleman
SELECT id,account FROM tablename WHERE detail LIKE '%pattern%' GROUP BY Account; -Original Message- From: Jaime Teng [mailto:[EMAIL PROTECTED]] I have a MySQL table: ... It should only return *one* result per account.

Re: need help with GROUP BY

2003-02-06 Thread Frank Peavy
Jaime, You should be using the DISTINCT function. SELECT DISTINCT account, id, FROM etc. This should give you one instant of 'account' in your SELECT output. At 09:24 AM 2/5/03 +, Jaime Teng wrote: I have a MySQL table:

Re: need help with GROUP BY

2003-02-06 Thread Frank Peavy
Jaime, You should be using the DISTINCT function. SELECT DISTINCT account, id, FROM etc. This should give you one instant of 'account' in your SELECT output. At 09:24 AM 2/5/03 +, Jaime Teng wrote: I have a MySQL table:

need help with GROUP BY

2003-02-05 Thread Jaime Teng
I have a MySQL table: ++--+--+-+-++ | Field | Type | Null | Key | Default | Extra | ++--+--+-+-++ | id | int(10) unsigned | | PRI | NULL