RE: Group By Problem

2011-02-08 Thread Peter He
You need to group by event_text, not obj_text: select source_id ,event_text,count(*) from event_loc group by source_id,event_text; > Date: Tue, 8 Feb 2011 16:31:39 +0530 > From: adarsh.sha...@orkash.com > To: mysql@lists.mysql.com > Subject: Group By Problem > > Dear

Group By Problem

2011-02-08 Thread Adarsh Sharma
Dear all, I stuck around one more simple problem today. I have a table named *event_loc* having below data : ( It has many columns but I show you main columns that I needed ) _*Tables Data :-*_ *source_idevent_text* 1233 meet 1233

Re: group by problem

2006-10-16 Thread chris smith
On 10/16/06, kalin mintchev <[EMAIL PROTECTED]> wrote: > > but that will get you all records for that category not just the most > recently updated. > that's the main problem, isn't it? what i'm looking for is the last record for EACH of the categories in the table. i'm aware of the aformentio

Re: group by problem

2006-10-16 Thread kalin mintchev
> > but that will get you all records for that category not just the most > recently updated. > that's the main problem, isn't it? what i'm looking for is the last record for EACH of the categories in the table. i'm aware of the aformentioned options. my problem with group by is that ignores th

Re: group by problem

2006-10-16 Thread Chris
kalin mintchev wrote: Basically you can't do what you want either without temporary tables or using a subselect. Subselects are only available in mysql 4.1+ (I think - check the docs) so that may or may not be an option. thanks... pardon my ignorance - how would i do that using subselects? Wi

Re: group by problem

2006-10-16 Thread kalin mintchev
> > Basically you can't do what you want either without temporary tables or > using a subselect. Subselects are only available in mysql 4.1+ (I think > - check the docs) so that may or may not be an option. thanks... pardon my ignorance - how would i do that using subselects? > -- MySQL Gen

Re: group by problem

2006-10-16 Thread Chris
kalin mintchev wrote: hi all... i have an issue with group by and ordering. apparently group by ignores 'order by id DESC'?! an example is a table that has an id and a category fields. there are a few categories under which records can be filed. so what i want is the latest record from each

group by problem

2006-10-16 Thread kalin mintchev
hi all... i have an issue with group by and ordering. apparently group by ignores 'order by id DESC'?! an example is a table that has an id and a category fields. there are a few categories under which records can be filed. so what i want is the latest record from each category by doing somet

group by problem

2005-04-19 Thread Wakan
Hi, I've 2 tables of payments 1: payment emission (P: --> ID,ID_cli,tot) 2: part payments (A: --> ID,P_ID,val) I'd like to retrieve all payment emissions, with all relative part payments(with a left join), for all ID_cli and I'd like to calculate the rest to pay...like tot-SUM(val). but I

Group by problem

2004-02-16 Thread Pawan Darira
Hi I am using mysql 3.23 & have a table 'scores' with following structure compint(11) scoreint(11) I have total 1 lakh rows consider following sample data compscore ~ 10.25 22.5 2.1.7 10.1 30.9 10.3 I w

Re: Group By Problem

2004-01-28 Thread Roger Baklund
* Lightware Software > Say I have the following table (TBL): > > KEY GRP VAL > 1 A 2 > 2 A 3 > 3 A 1 > > 4 B 2 > 5 B 1 > 6 B 3 > > "select KEY, max(VAL) from TBL group by GRP" gives: > > KEY max(VAL) > > 1 3 > 4 3 > > the desired result though is: > > KEY max(VAL) > ---

Group By Problem

2004-01-28 Thread Lightware Software
Say I have the following table (TBL): KEY GRP VAL 1 A 2 2 A 3 3 A 1 4 B 2 5 B 1 6 B 3 "select KEY, max(VAL) from TBL group by GRP" gives: KEY max(VAL) 1 3 4 3 the desired result though is: KEY max(VAL) 2 3 6 3 any ideas on how to achieve this ? Apparent

Re: Group by problem

2002-12-15 Thread Heikki Tuuri
Dmitry, - Original Message - From: "Dmitry Kosoy" <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Sunday, December 15, 2002 7:11 PM Subject: RE: Group by problem > Hi, > > I checked it with 3.23.54 on Windows > and got the same incorrect result

RE: Group by problem

2002-12-15 Thread Dmitry Kosoy
Hi, I checked it with 3.23.54 on Windows and got the same incorrect results. Regards, Dmitry -Original Message- From: Heikki Tuuri [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 11:30 PM To: [EMAIL PROTECTED] Subject: Re: Group by problem Dmitry, - Original

Re: Group by problem

2002-12-12 Thread Heikki Tuuri
Dmitry, - Original Message - From: "Dmitry Kosoy" <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Thursday, December 12, 2002 8:02 PM Subject: Group by problem > Hi, > > The following sql operators caused to incorrect results: > > C

Group by problem

2002-12-12 Thread Dmitry Kosoy
Hi, The following sql operators caused to incorrect results: CREATE TEMPORARY TABLE temp_list ( CurrID char(42) NOT NULL, OriginalID char(42) NOT NULL , DocRevision int(16) unsigned NOT NULL ) TYPE=InnoDB; insert into temp_list select CurrID, OriginalID, max(DocRevision) from some_tab

Re: timestamp(8) GROUP BY problem

2002-05-28 Thread Keith C. Ivey
On 27 May 2002, at 22:32, [EMAIL PROTECTED] wrote: > mysql> SELECT dd,count(*) FROM test GROUP BY dd; > +--+--+ > | dd | count(*) | > +--+--+ > | 20020527 |1 | > | 20020527 |1 | > | 20020527 |1 | > | 20020527 |1 | > +--

Re: timestamp(8) GROUP BY problem

2002-05-28 Thread Egor Egorov
sitnikov, Monday, May 27, 2002, 10:32:07 PM, you wrote: s> Description: s> Problem with timestamp(8) and GROUP BY s> How-To-Repeat: mysql>> CREATE TABLE test ( s> -> id int auto_increment, s> -> dd timestamp(8), s> -> data int, s> -> PRIMARY KEY (id) s> -> ); s> Quer

Re: timestamp(8) GROUP BY problem

2002-05-28 Thread Gerald Clark
try timestamp(14) instead. [EMAIL PROTECTED] wrote: >Description: > Problem with timestamp(8) and GROUP BY > >How-To-Repeat: > >mysql> CREATE TABLE test ( >-> id int auto_increment, >-> dd timestamp(8), >-> data int, >-> PRIMARY KEY (id) >-> ); >Query OK, 0 rows affecte

timestamp(8) GROUP BY problem

2002-05-27 Thread sitnikov
Description: Problem with timestamp(8) and GROUP BY How-To-Repeat: mysql> CREATE TABLE test ( -> id int auto_increment, -> dd timestamp(8), -> data int, -> PRIMARY KEY (id) -> ); Query OK, 0 rows affected (0.01 sec) mysql> INSERT INTO test (data) VALUES(1),(2),(3),(4

Re: SELECT DISTINCT or GROUP BY problem

2001-05-07 Thread Sasha Pachev
On Monday 07 May 2001 03:37, Andrew Leshkin wrote: > Hello, > > I have the following perfomance problem with simple query on one of my > servers: > > Here is my table ~6 records. > > +-+-+--+-++- > ---+ > | Field | Type

Re: GROUP BY problem.

2001-03-03 Thread Bob Hall
Sir, look up Rand and ORDER BY in the documentation. I believe there's an example of using Rand and ORDER BY to do this. Bob Hall >Thanks for the answer. but actually I'm not saying that mysql is doing >wrong, I just want to know HOW can I group by codigo and then get 10 random >rows of the gro

Re: GROUP BY problem.

2001-02-28 Thread Angel Behar
Thanks for the answer. but actually I'm not saying that mysql is doing wrong, I just want to know HOW can I group by codigo and then get 10 random rows of the grouped ones. Hope I explain me. Thanks again. > Angel Behar wrote: > > > > Hi !!! > > > > I'm running 3.23.28-gamma under windows NT,

Re: GROUP BY problem.

2001-02-28 Thread Gerald L. Clark
Angel Behar wrote: > > Hi !!! > > I'm running 3.23.28-gamma under windows NT, but I have the following > problem. > I need to query some data and gruop by some field (codigo in this case) so I > run the following query : > > SELECT codigo from ropa where cve_depto='3' AND cve_clase='06' AND a

GROUP BY problem.

2001-02-27 Thread Angel Behar
Hi !!! I'm running 3.23.28-gamma under windows NT, but I have the following problem. I need to query some data and gruop by some field (codigo in this case) so I run the following query : SELECT codigo from ropa where cve_depto='3' AND cve_clase='06' AND activo = 'A' AND p_credito <> 0 GROUP