GROUP BY - CONCAT query question?

2002-11-08 Thread Shyamal Banerjee
Hi, You can try the following. Store the result of your query into a temporary table, say tp, with two columns tc (ticketID) and pname (pipelineName). Run the following query : select concat("select @c:='';","select tc, (@c:=concat_ws("","",@c,pname)) as x, length(@c) from tp where tc=", tc," o

GROUP BY - CONCAT query question?

2002-11-06 Thread mysql
Hi all. 3 tables. "Ticket" "Pipeline_Dept", and "Ticket_Matrix". Ticket_Matrix matches tickets to pipeline depts. A ticket can be posted to multiple pipeline depts. I want to select all tickets and the pipeline departments they are posted to but only one row per ticket. So: SELECT

Re: group by concat

2001-07-09 Thread Bob Hall
>Hi! > >My problem is when I use group by concat(col1,col2) when col1 and col2 >is primary keys and col1 is varchar(255): > >SELECT col1,col2 FROM Table1 GROUP BY concat(col1,col2); >-> return only one row - it is bad > >SELECT col1,col2 FROM Table1 GROUP BY concat(

group by concat

2001-07-09 Thread Marek Chlup
Hi! My problem is when I use group by concat(col1,col2) when col1 and col2 is primary keys and col1 is varchar(255): SELECT col1,col2 FROM Table1 GROUP BY concat(col1,col2); -> return only one row - it is bad SELECT col1,col2 FROM Table1 GROUP BY concat(col1,col1,col2); -> return 48 row