Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Join multiple rows in the same table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-11-18 : 08:32:28
sysjyo writes "I want to build a sql query to join multiple rows from the same table.

TABLE1
COLUMN1
1
1
2
2
3
3

COLUMN2
1
2
2
3
1
3

COLUMN1 AND COLUMN2 ARE COMPOSITE PRIMARY KEYS.

The query results should also combine COLUMN2 result based on COLUMN1. The result look like the following
Column1
1
2
3
Column2
1,2
2,3
1,3

Thanks."

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-11-18 : 09:06:10
I'm not sure I follow, can you please describe what logic is used to get those results? and why did you list the columns separately for that table -- are there 6 rows in this table or 12?

Finally, are you looking to return a 2-column resulset or a single column resultset in which numbers are delimited by commas?

- Jeff
Go to Top of Page
   

- Advertisement -