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.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-10-21 : 08:48:45
|
Ann writes "See if you could solve this quite complex (unusual?) problem.I need to model this data relationship in SQL Server 2000 table/s? AAA -----> 111AAA -----> 222AAA -----> 333AAA -----> 444AAA -----> AAA111 -----> 222222 -----> 111111 -----> 111A real life example: AAA at HQ ordered 4 items, one for his main office and the others for each of his three branch offices. I need to flag AAA as 'billed to' and 'shipped to'. The other three offices (111, 222, 333) need to be flagged as 'shipped to' only.billed shippedAAA -----> 111AAA -----> 222AAA -----> 333AAA -----> AAANow, branch office 111 placed an order ('billed to') and had it shipped to another branch office 222 ('shipped to') and vice versa. Branch office 111 can also place an order for itself, i.e., it will be flagged as 'shipped to' and 'billed to'.billed shipped111 -----> 222222 -----> 111111 -----> 111In other word, a record parent has child records, then a child record becomes a parent of another child record, or single record can be a parent and a child (AAA -----> AAA, BBB---->BBB). A query to go with the table/s will be nice too. Thank you in advance for you help. Your prompt response is greatly appreciated.Ann " |
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-10-21 : 08:55:53
|
Do you get paid to do this ?Damian |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2002-10-21 : 11:57:52
|
I smell homework....<Yoda>Use the Search page you must. Find the answer you will.</Yoda> |
|
|
Lavos
Posting Yak Master
200 Posts |
Posted - 2002-10-21 : 20:21:57
|
Both of those possibilities are kind of depressing to me.----------------------"O Theos mou! Echo ten labrida en te mou kephale!" |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2002-10-21 : 22:12:49
|
Assumming that you are saying you have a table with the following data: Shipped | BilledAAA 111AAA 222AAA 333111 222222 111111 111What is the question???? Are you asking how to store the data or how to retrieve certain information? If it's the later then what information do you need from the data? |
|
|
|
|
|