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
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
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
>
> 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
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
>
> 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
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
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
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
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
* 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)
> ---
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
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
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
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
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
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 |
> +--
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
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
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
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
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
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,
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
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
25 matches
Mail list logo