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
 General SQL Server Forums
 New to SQL Server Programming
 finding several data from one column

Author  Topic 

top106
Starting Member

1 Post

Posted - 2008-12-24 : 08:20:02
in table I have two cloumn
ID
and
ID6 that repersent joined account that have several partners ID

for example:

ID ID6
====== ===========
11215 6100
11152 6100
11242 6101
11523 6101
11125 6101
11254 6101
..... ....
there is about 60,000 rows

I have a table with several ID in a row and I need to find the missing ID6 if it exist (not all ID are join account) and put it in that row if exist

the table look like this

11523,11125,11254, 11242
11658,15662
11458
11215,11152
.........
there is about 5,000 rows
I use plsql developer.

How do I do that ?

ELI

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-24 : 08:22:35
This is SQL Server Forum.You need to post in Oracle forum.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-24 : 11:02:32
quote:
Originally posted by top106

in table I have two cloumn
ID
and
ID6 that repersent joined account that have several partners ID

for example:

ID ID6
====== ===========
11215 6100
11152 6100
11242 6101
11523 6101
11125 6101
11254 6101
..... ....
there is about 60,000 rows

I have a table with several ID in a row and I need to find the missing ID6 if it exist (not all ID are join account) and put it in that row if exist

the table look like this

11523,11125,11254, 11242
11658,15662
11458
11215,11152

Can you layout the structure of columns? And how you want to append to it?
.........

there is about 5,000 rows
I use plsql developer.

How do I do that ?

ELI



Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2008-12-24 : 23:52:02
it will work in sql-2005

select distinct stuff((select ','+ cast(id AS varchar(12)) from urtable where id6 = t.id6 for xml path('')),1,1,'') from urtable t
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-25 : 10:20:16
quote:
Originally posted by bklr

it will work in sql-2005

select distinct stuff((select ','+ cast(id AS varchar(12)) from urtable where id6 = t.id6 for xml path('')),1,1,'') from urtable t




Did you read question properly?
Go to Top of Page
   

- Advertisement -