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
 Is this possible?

Author  Topic 

intergalacticplanetary
Starting Member

12 Posts

Posted - 2007-02-12 : 00:23:51
i have a 2-column table for multivalued attributes (fac_id, sic_id), the combination of the two is the PK. As expected, there are numerous records for any particular fac_id, each specifying a different sic_id. i want to ouput the query listing all the combinations for any particular fac_id in the following horizontal format (rather than listing it vertically and repeating the fac_id for the particular number of sic_id's associated with it):

fac_id_1 sic_id_1 sic_id_2
fac_id_2 sic_id_1
fac_id_3 sic_id_1 sic_id_2 sic_id_3
...

can i do this in the database or do i need to write code for this?
thanks in advance!

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-02-12 : 00:30:15
take a look here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53293

There is a great article on the subject here http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx but it is not accessible now.


KH

Go to Top of Page

intergalacticplanetary
Starting Member

12 Posts

Posted - 2007-02-12 : 00:38:42
again, i tip my hat to you KH.

regards
Go to Top of Page
   

- Advertisement -