Re: Getting no of different rows by group by clause

2005-11-22 Thread Rhino
ing no of different rows by group by clause Hi Friends, I have a table like name MAD LHR MAD LHR AKL AWL AKL LHR I want the output as: LHR 3 AKL 2 AWL 1 etc... ie the no of entires sorted by their no of appearences. I cannot do that by select name from tab_name group by name as it will not g

Re: Getting no of different rows by group by clause

2005-11-22 Thread Peter Brawley
Abhishek >I want the output as: >LHR 3 >AKL 2 >AWL 1... >ie the no of entires sorted by their no of appearences. SELECT tbl.name AS Name, COUNT( tbl.name) AS Count FROM tbl GROUP BY tbl.name ORDER BY Count DESC; PB [EMAIL PROTECTED] wrote: Hi Friends, I have a table like name MAD LHR

Re: Getting no of different rows by group by clause

2005-11-22 Thread Jeremy Cole
Hi Abishek, I want the output as: LHR 3 AKL 2 AWL 1 This should do it: SELECT name, COUNT(*) as num FROM tab_name GROUP BY name ORDER BY num DESC Regards, Jeremy -- Jeremy Cole MySQL Geek, Yahoo! Inc. Desk: 408 349 5104 -- MySQL General Mailing List For list archives: http://lists.mysql.c

Getting no of different rows by group by clause

2005-11-22 Thread [EMAIL PROTECTED]
Hi Friends, I have a table like name MAD LHR MAD LHR AKL AWL AKL LHR I want the output as: LHR 3 AKL 2 AWL 1 etc... ie the no of entires sorted by their no of appearences. I cannot do that by select name from tab_name group by name as it will not give me the no of rows. Pl. help me to find i

Re: Lost connection to Mysql server during query using a group by clause and sub query

2005-05-19 Thread Ware Adams
On May 19, 2005, at 12:51 AM, Dan Rossi wrote: Hi there, I am having issues with this funny error message. I am trying to do a sub query and then a group by clause on a date. However i keep getting this annoying message for some reason. Happens via terminal aswell as my sql gui. Here is the

Lost connection to Mysql server during query using a group by clause and sub query

2005-05-18 Thread Dan Rossi
Hi there, I am having issues with this funny error message. I am trying to do a sub query and then a group by clause on a date. However i keep getting this annoying message for some reason. Happens via terminal aswell as my sql gui. Here is the query I am trying to do select (select count

Re: Group By - Is there a way to set which rows values are used for the fields not in the Group By clause?

2005-04-19 Thread Rich Carr
lcount, itemname from viewvisitor where ownerid = 2 GROUP BY concat( app, itemid ) ORDER BY totalcount; Rich Carr wrote: >Is there a way to set which rows values are used by the GROUP BY clause for >the fields that are not in the GROUP BY clause? > >In this following select statement the

Re: Group By - Is there a way to set which rows values are used for the fields not in the Group By clause?

2005-04-18 Thread Vivian Wang
BY clause for the fields that are not in the GROUP BY clause? In this following select statement the group by and order work but the value of the lastviewtime field is not the value of the most recent datetime row. Is there any way to modify the select statement so that the returned lastviewtime

Re: Group By - Is there a way to set which rows values are used for the fields not in the Group By clause?

2005-04-12 Thread Rich Carr
| >+--++--+ > >or GROUP_ROW(cols,sortby=) > >-- More sillyness >SELECT id, group_row(child_id,type,sortby=rand()) >FROM chi2 GROUP BY id; > >Just an idea. > >Dan. > >On Mon, 11 Apr 2005, Rich Carr wrote: > >>Is there a way to set which ro

Re: Group By - Is there a way to set which rows values are used for the fields not in the Group By clause?

2005-04-12 Thread Dan Bolser
t;+--++--+ >| 1 | 1 | 0 | >| 5 | 2 | 2 | >+--++--+ > >or GROUP_ROW(cols,sortby=) > >-- More sillyness >SELECT id, group_row(child_id,type,sortby=rand()) >FROM chi2 GROUP BY id; > >Just an idea. > >Dan. > >On Mon, 11 Apr

Re: Group By - Is there a way to set which rows values are used for the fields not in the Group By clause?

2005-04-12 Thread Dan Bolser
id, group_row(child_id,type,sortby=rand()) FROM chi2 GROUP BY id; Just an idea. Dan. On Mon, 11 Apr 2005, Rich Carr wrote: >Is there a way to set which rows values are used by the GROUP BY clause >for the fields that are not in the GROUP BY clause? > In this following select statement

Group By - Is there a way to set which rows values are used for the fields not in the Group By clause?

2005-04-11 Thread Rich Carr
Is there a way to set which rows values are used by the GROUP BY clause for the fields that are not in the GROUP BY clause? In this following select statement the group by and order work but the value of the lastviewtime field is not the value of the most recent datetime row. Is there any

RE: GROUP BY Clause

2005-02-25 Thread Tom Crimmins
On Friday, February 25, 2005 15:05, Asad Habib wrote: > I am trying to use GROUP BY with a field of type text that is set to > NOT NULL by default. However, in practice this field does not always > contain a string for every record and defaults to the empty string in > this case. When I try to us

GROUP BY Clause

2005-02-25 Thread Asad Habib
I am trying to use GROUP BY with a field of type text that is set to NOT NULL by default. However, in practice this field does not always contain a string for every record and defaults to the empty string in this case. When I try to use GROUP BY with this field in a SELECT statement, only 1 record

RE: Get counts of col=value with an GROUP BY clause?

2004-01-05 Thread Mike Johnson
From: Greg Owen [mailto:[EMAIL PROTECTED] > I'm trying to build a query to show counts of specific > columns by value. > There's probably a simple way to do this that I don't know > about, and if you could just point me to the function or part > of the manual to research before you start lau

Re: Get counts of col=value with an GROUP BY clause?

2004-01-05 Thread Tobias Asplund
On Mon, 5 Jan 2004, Greg Owen wrote: > I tried (you can laugh here) to do it this way, but failed miserably: > > mysql> select class,count(questnum),count(difficulty='0'), >count(difficulty='1'),count(difficulty='2'), >count(in_use='0'),count(in_use='1') from Questions >group by class;

Get counts of col=value with an GROUP BY clause?

2004-01-05 Thread Greg Owen
I'm trying to build a query to show counts of specific columns by value. There's probably a simple way to do this that I don't know about, and if you could just point me to the function or part of the manual to research before you start laughing, I'd greatly appreciate it. Given the following

Re: String functions for GROUP BY clause

2003-11-12 Thread Diana Soares
> Is there a way to use a string concatenating function in connection with a > GROUP BY clause? I mean, for a one-to-many relation (like firm-stockholders > relation), to "catch" a structure like: > > firm | stocholders > > f_1 | s_1; s_2

String functions for GROUP BY clause

2003-11-12 Thread Ciprian Trofin
Is there a way to use a string concatenating function in connection with a GROUP BY clause? I mean, for a one-to-many relation (like firm-stockholders relation), to "catch" a structure like: firm | stocholders f_1 | s_1; s_2; s_3 f_2 | s_4; s_5 f_3 | s_6 inste

Re: group by clause

2003-06-27 Thread gerald_clark
That can't be the output of the query. The fourth column would me titled 'soma' There is no seperator bar between the data for sw_or_local and soma on the data lines. Fabio Bernardo wrote: hi there I wrote this querie : select pop, prot, sw_or_local, sum(qtd_porta) as soma from clientes where s

Re: group by clause

2003-06-26 Thread Bruce Feist
Fabio Bernardo wrote: select pop, prot, sw_or_local, sum(qtd_porta) as soma from clientes where status<>'C' group by pop,prot,sw_or_local And I have this result : +++-++ | pop| prot | sw_or_local | sum | +++-++ |B

group by clause

2003-06-26 Thread Fabio Bernardo
hi there I wrote this querie : select pop, prot, sw_or_local, sum(qtd_porta) as soma from clientes where status<>'C' group by pop,prot,sw_or_local And I have this result : +++-++ | pop| prot | sw_or_local | sum | +++-+---

group by clause

2002-09-11 Thread Hilal Achmad
: i have one table with 4 fields (nik,name,child_name,child_number) i wan to query that the result will be like this +--+---++++ + | nik | name | child1 | child2 | child3 | child4 | +--+---++++ + | 1 | pai | mai | NUL

Re: urgent : Problem in Group by clause

2002-02-16 Thread Teri Salisbury
ruary 16, 2002 3:42 PM Subject: urgent : Problem in Group by clause hi all, i have a problem in mysql query... lemme state the scenario... i have a table 'UploadDetails' in which i am storing data regd files... the fields are: FileName, Title, Designer, UploadedBy, SubmittedDate i

urgent : Problem in Group by clause

2002-02-16 Thread SankaraNarayanan Mahadevan
hi all, i have a problem in mysql query... lemme state the scenario... i have a table 'UploadDetails' in which i am storing data regd files... the fields are: FileName, Title, Designer, UploadedBy, SubmittedDate i want to get details about whose files are designed by who..etc... that is i need

urgent : Problem in Group by clause

2002-02-16 Thread SankaraNarayanan Mahadevan
hi all, i have a problem in mysql query... lemme state the scenario... i have a table 'UploadDetails' in which i am storing data regd files... the fields are: FileName, Title, Designer, UploadedBy, SubmittedDate i want to get details about whose files are designed by who..etc... that is i need

Re: Group by clause

2002-02-02 Thread DL Neil
Serge, > Is it possible in mySQL to GROUP BY months on a date field? > For example: > SELECT invDate,prdCategory,sum(prdPrice) > GROUP BY left(invDate,6),prdCategory > If invDate is in the format 20020202 > then group by the first 6 characters > would return the total of sales > by product catego

Re: Group by clause

2002-02-02 Thread Serge Grenier
Is it possible in mySQL to GROUP BY months on a date field? For example: SELECT invDate,prdCategory,sum(prdPrice) GROUP BY left(invDate,6),prdCategory If invDate is in the format 20020202 then group by the first 6 characters would return the total of sales by product category and by month. I

RE: group by clause

2001-10-19 Thread Steve Meyers
ng up the ordering? Steve Meyers > -Original Message- > From: Sommai Fongnamthip [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 19, 2001 3:19 AM > To: [EMAIL PROTECTED] > Subject: group by clause > > > Hi, > did someone tell me why group by clause

group by clause

2001-10-19 Thread Sommai Fongnamthip
Hi, did someone tell me why group by clause not work? I'd like to group volume of order from my customer at the same price and my supplier. here is my code Select custid, symbol, sum(volume) as sumvol, price, mktid, supplier, supplierflag From confirm

Re: group by clause

2001-10-18 Thread Gerald Clark
You might want to add an ORDER BY clause. Sommai Fongnamthip wrote: > Hi, > did someone tell me why group by clause not work? I'd like to group > volume of order from my customer at the same price and my supplier. > here is my code > > Select custid, symbol

group by clause

2001-10-17 Thread Sommai Fongnamthip
Hi, did someone tell me why group by clause not work? I'd like to group volume of order from my customer at the same price and my supplier. here is my code Select custid, symbol, sum(volume) as sumvol, price, mktid, supplier, supplierflag From confirm

Group By clause is behaving two different way?

2001-09-13 Thread selva
Hi I am using windows2000 server and MYSQL ver3.23.41-win and Active Server Pages to retreive MYSQL result set to my webpage, It is retreiving well if there is only one row in the table( It is not reaching EOF immediately), but if there is more then one row (in group by result) then immediately r