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 2005 Forums
 Transact-SQL (2005)
 Mutiple records into a single row

Author  Topic 

ank16437
Starting Member

1 Post

Posted - 2010-05-13 : 08:20:13
I have two tables X and Y . X and Y both have a column "Account".This column is unique in X while for an Account in X there are multiple records in Y.
I want to display all records with same "Account" from X and Y in same row.
Eg...
X table -
Account A1 B1 C1
123 a q
234 b f
345 c v

Y table -
Account A1 B1 C1
123 a q
123 b f
345 c v
345 R T
234 D F


So records of both X and Y table with same Account should be displayed in one row. How can I achieve it..
Thanks in advance

mrm23
Posting Yak Master

198 Posts

Posted - 2010-05-13 : 08:30:01
can you give us the desired output?
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-13 : 08:36:50
...and maybe example data that makes more sense.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-05-13 : 10:34:25
you mean distinct sets of values or all values? also will you be certain on number of values always?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -