Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2006, 09:19 AM
Authorized User
 
Join Date: Nov 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default sql - concating columns for rows with same ID

Hi All,

I have a table as follow :

ID Value
1 aaa
1 bbb
2 ccc
3 ddd

I want to have the following as a result

1 aaa + bbb
2 ccc
3 ddd

that is to concat the columns which their rows have the same ID.

any idea?

Thank you,
Yuval
__________________
Yuval Kronenfeld
Israel
 
Old September 8th, 2006, 04:45 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

Is there a limit to how many rows might have the same id value?

David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com
 
Old September 13th, 2006, 01:35 PM
Authorized User
 
Join Date: Nov 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ,

No there is no limit.
But it will be something like2 or 3 times.

Yuval

Yuval
 
Old September 20th, 2006, 04:51 PM
Registered User
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can use inline views, at least Oracle's sql has this functionality

 
Old September 26th, 2006, 10:16 AM
Authorized User
 
Join Date: Nov 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mike,

Its sql Server 2000/2005

Yuval

Yuval
 
Old September 26th, 2006, 10:46 AM
Registered User
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it does not really matter. It's sql language.

 
Old September 26th, 2006, 10:47 AM
Registered User
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it does not really matter in this case SQL Server or Oracle or DB2. It's sql language.






Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Query to Convert Columns into Rows Niaz Oracle 3 February 5th, 2010 07:08 AM
SQL Query to convert Columns into Rows....again phix SQL Server 2000 11 November 11th, 2007 09:59 AM
convert columns to rows in sql hoangmv0101 SQL Language 0 January 2nd, 2007 02:04 AM
Formatting sql query rows as columns with stack sastian PHP Databases 0 March 25th, 2005 04:51 AM
SQL Query to Convert Columns into Rows Niaz SQL Server 2000 2 April 20th, 2004 01:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.