Re: [SQL] "select c1, method(c2) group by c1" returns all values of c2 for c1

2011-02-08 Thread Rolando Edwards
SELECT distinct c1,array_to_string(array(SELECT c2 FROM T1 B where A.c1=B.c1),', ') from T1 A order by c1; Give it a Try !!! Rolando A. Edwards MySQL DBA (SCMDBA) 155 Avenue of the Americas, Fifth Floor New York, NY 10013 212-625-5307 (Work) 201-660-3221 (Cell) AIM & Skype : RolandoLogicWorx re

Re: [SQL] inner join and limit

2010-05-26 Thread Rolando Edwards
I found a good solution. drop table if exists t3; drop table if exists t2; drop table if exists t1; create table t1 ( id int primary key, title varchar(10) ); insert into t1 values (1,'abcde'),(2,'fghi'); create table t2 (id int primary key,t1id int not null references t1 (id) ,somedate date); in

Re: [SQL] inner join and limit

2010-05-26 Thread Rolando Edwards
I can only see a LIMIT 1 possible. If someone can come up with LIMIT N on this one, please let us all know. rolando=# drop table if exists t2; DROP TABLE rolando=# drop table if exists t1; DROP TABLE rolando=# create table t1 ( id int primary key, title varchar(10) ); NOTICE: CREATE TABLE / PRIM