473,383 Members | 1,868 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,383 software developers and data experts.

merge rows of data within a table

I hope someone here can help me. I am trying to merge rows of data within a table. Here's what I have

Guest id: Row: Section: Seat:
567 A CC 102
567 A CC 103
567 A CC 104

What I need to get is one row that says:

Guestid: Seats:
567 ACC102 - 104

Can anyone help me?
May 31 '07 #1
2 2925
Motoma
3,237 Expert 2GB
I hope someone here can help me. I am trying to merge rows of data within a table. Here's what I have

Guest id: Row: Section: Seat:
567 A CC 102
567 A CC 103
567 A CC 104

What I need to get is one row that says:

Guestid: Seats:
567 ACC102 - 104

Can anyone help me?
Expand|Select|Wrap|Line Numbers
  1. SELECT Guest_ID, Row, Section, MIN(Seat) AS First, MAX(Seat) AS Last FROM Table GROUP BY Guest_ID. Row, Section
  2.  
Jun 1 '07 #2
Thanks! I'll try that!
Jun 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: webtrack+googlegroups | last post by:
I'm trying automate a mail merge in VB.Net as a spike/proof-of-concept. The resulting mail merge document should look very roughly like this: <<Customer FullName>> <<Customer Address>> Dear...
3
by: Richard Fritzler | last post by:
I was given the task of designing a complete web based document prep system. In simplest terms (using a msword explanation) create a database of merge fields, and a library of templates. Allow the...
4
by: John Smith | last post by:
..Net 2003 C# I get xml from a sql database pull. I put the data into a XMLDomDocument and then the user changes it. I now need to update the database correctly. I need to be able to get the data...
0
by: Sheila | last post by:
I have set up a Word mail merge document of the type Directory which allows me to display all of the records on a single page rather than putting each record on a separate page. It uses a...
16
by: Sam Durai | last post by:
Hello, I need to merge a small table (of rows less than 100,sometimes even 0 rows) to a big table (of rows around 4 billion). I used the PK of the big table as merge key but merge does a table scan...
5
by: Mark Chambers | last post by:
Hi there, Can anyone explain the following (very) simple scenario. 1) I make an exact copy of my "DataSet" and delete one record from a given table (in the copy) 2) I invoke...
7
by: Michel Esber | last post by:
Question About Merge DB2 V8 LUW FP 15. Hello, Consider table A (ID integer not null PK, Field2 varchar(50)). I have the existing following set of rows in the table:
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
24
by: Henry J. | last post by:
My app needs to insert thousand value rows into a mostly empty table (data are read from a file). I can either use inserts, or use merge. The advantage of using merge is that in the few cases...
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.