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)
 article structure transformation

Author  Topic 

pipeclay
Starting Member

3 Posts

Posted - 2006-12-17 : 10:04:12
I am currently developing a small application which will calculate a total cost for a product in a business system. I am currently having a bit of problem with the sql parts though and I hope you can help me. The situation is as follow:

One table consists of the article structure like this:
Article | Consists Of
a | b
b | c
c | d

I want this transformed to:
Article | Consists Of
a | b
a | c
a | d

It seems simple enough but my sql programming is a bit rusty to say the least. Lend a hand?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-17 : 10:37:42
I can't seem to get the logic behind the transformation...What do you really want to do?

Update tbl
set Article = 'a'
Where [Consists of] in ('b', 'c', 'd')


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

pipeclay
Starting Member

3 Posts

Posted - 2006-12-17 : 12:15:16
Well, the structure was just an example. The thing is that an article can consist of an article which in turn can consist of an article. This leading to article A have subarticle B. B can in turn have another subarticle C. This means that A actually consists of both B and C which is not showed directly, only that A consists of B and B consists of C What I want is to show that A consists of both B and C.

Hope that made it more clear.
Go to Top of Page

pipeclay
Starting Member

3 Posts

Posted - 2006-12-17 : 12:16:45
And as a side note, I cannot change the database I am reading from, I have to read it to a new one.
Go to Top of Page
   

- Advertisement -