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

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

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
It was my understanding that it should actually work that way, but SQL does not guarantee that with GROUP BY clauses -- you would want to use an ORDER BY clause if you want to guarantee order. The problem could be in one of your char fields -- maybe an extra space somewhere that's messing up

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, sum(volume) as sumvol,