Re: LIMIT in subquery or GROUP_CONCAT

2005-11-18 Thread Felix Geerinckx
On 17/11/2005, Peter Brodersen wrote: > I would like to select top three from different parts in the same > table, e.g. for the following data set: USE test; DROP TABLE IF EXISTS foo; CREATE TABLE foo ( fid INT NOT NULL, d INT NOT NULL ); INSERT INTO foo VALUES (1, 10), (1, 20),

Re: LIMIT in subquery or GROUP_CONCAT

2005-11-17 Thread Gleb Paharenko
Hello. I've written a stored procedure that can help you. However, I'd like to see a solution which will work for 4.1 as well. Here is the results. First group is select from the original table, second group is select from the temporary table with the results. id value 1 10

LIMIT in subquery or GROUP_CONCAT

2005-11-16 Thread Peter Brodersen
Hi, (mysql server 5.0.15 running under linux) I suppose this is a classic task. I just hope MySQL 5.0 is able to give the right result. I would like to select top three from different parts in the same table, e.g. for the following data set: id,value 1,10 1,20 1,30 1,40 1,50 2,10 2,20 2,30 2,40