MySQL Forums
Forum List  »  InnoDB

Re: Group by
Posted by: Roland Bouman
Date: January 08, 2006 07:53AM

For 3.23, you should probably solve it by doing it in two steps.

The first step would store the the result of the group by in a (temporary) table;
the second step would join the temporary table to the original data set:

insert
into my_temp_table(
id int
)
select max(id)
from table1
group by col1
;

select t1.*
from table1 t1
inner join my_temp_table tt1
on tt1id = t1.id
;

Options: ReplyQuote


Subject
Views
Written By
Posted
3274
January 06, 2006 06:34AM
1780
January 06, 2006 01:55PM
1720
January 07, 2006 01:06AM
1742
January 07, 2006 02:49AM
1859
January 08, 2006 07:42AM
Re: Group by
1852
January 08, 2006 07:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.