473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SQL Q: Concatenate multiple rows on same column.

I have a concatenation problem and I was wondering if somebody might be
able to offer some help :-)

I have the following table structure holding product long descriptions:

Part No (pn) Sequence (seq) Long Description (long_desc)
--------------- --------------- ----------------------------------------
HL1450 10 This is part of a long description and
HL1450 20 it overlaps onto several lines. I'm
HL1450 30 having difficulty writing the SQL that
HL1450 40 is needed to make this work...
I need to write SQL that will give me the following output:

Part No Long Description
--------------- --------------------------------------------------------
HL1450 This is part of a long description and it overlaps onto
several lines. I'm having difficulty writing the SQL that is needed
to make this work...

(Essentially it a GROUP BY on the part number with an ORDER by on the
sequence field). However, I know how to concatenate multiple columns on
the same row (using the CONCAT or CONCAT_WS functions) but I'm at a loss
over how to concatenate the same column over multiple _rows_

I am aware of the GROUP_CONCAT function, but we are currently running
MySQL 4.0.13 (this functionality is only available on a vers > 4.1)

If any one has a suggestion as how I should go about this one I would
really appreciate it.

Kind regards, Nick

--
Nick Heppleston
07989 581766 | ni************@gmx.co.uk

The Funky PC - http://www.thefunkypc.biz

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 6232

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nick Heppleston | last post by:
I have a concatenation problem and I was wondering if somebody might be able to offer some help :-) I have the following table structure holding product long descriptions: Part...
6
by: Steven An | last post by:
Howdy, I need to write an update query with multiple aggregate functions. Here is an example: UPDATE t SET t.a = ( select avg(f.q) from dbo.foo f where f.p = t.y ), t.b = ( select sum(f.q)...
2
by: caro | last post by:
Hi I am trying to write two Select * statements to the same text file using bcp (from a stored procedure). But cannot find a way of appending to a file using bcp. Does anyone know if this...
1
by: Sharknwfk | last post by:
Hi, Hoping someone can help. I am trying to concatenate the ages of still living children divided into male & female. So, male 23, female 25, male 13, female 18 should look like this. ...
1
by: Bob Loveshade | last post by:
I am looking for an example that shows how to select and highlight multiple rows in a DataGrid. My DataGrid is part of a Web User Control which is contained in an ASPX page. I haven't been...
7
by: samoore33 | last post by:
I want to list all of the items in a dataset in a textbox. The dataset has multiple tables. When I try to use the code below, even though I dim myState as the DataTable("state"). It still looks for...
12
by: parth | last post by:
Hi I want to achieve the following transformation of data using a stored procedure. Source col1 col2(varchar) -------------------------
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.