473,325 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

SQL Challenge Urgent, Please help

Dip
Hello Expert,
Here I am asking your help.
I have a table with following data:
TaskID ParentTaskID TaskName ProjectName
1 1 BA Rail
2 22 FA Financial
3 1 BA.1 Rail
4 1 BA.2 Rail
5 22 FA.1 Financial
6 22 FA.2 Financial

Now I want the following format:

ID ParentID Name
1 1 Rail
2 1 BA
3 2 BA.1
4 2 BA.2
5 22 Financial
6 5 FA.1
7 5 FA.2

I need to create following hierarchy if I could tranform the data the
above way in the Project Dimension:
Rail
--BA
----BA.1
----BA.2
Financial
--FA
----FA.1
----FA.2
Please help and thanks in advance,
Soumya

Aug 9 '06 #1
2 939
Look at "Expanding Hierarchies" in SQL Server 2000 BOL. I think that
should help

Dip wrote:
Hello Expert,
Here I am asking your help.
I have a table with following data:
TaskID ParentTaskID TaskName ProjectName
1 1 BA Rail
2 22 FA Financial
3 1 BA.1 Rail
4 1 BA.2 Rail
5 22 FA.1 Financial
6 22 FA.2 Financial

Now I want the following format:

ID ParentID Name
1 1 Rail
2 1 BA
3 2 BA.1
4 2 BA.2
5 22 Financial
6 5 FA.1
7 5 FA.2

I need to create following hierarchy if I could tranform the data the
above way in the Project Dimension:
Rail
--BA
----BA.1
----BA.2
Financial
--FA
----FA.1
----FA.2
Please help and thanks in advance,
Soumya
Aug 9 '06 #2
Get a copy of TREES & HIERARCHIES IN SQL for several diffrent ways to
model this kind of problem.

Aug 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen...
2
by: learner | last post by:
Hi, In a page, i have many links. I have some functions in a global file which is included in all linked pages. I want to have a reference to a window which is to be opened on clicking one link...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: Dimitri | last post by:
PLEASE HELP,I HAVE A DATABSE WITH MULTIPLE RECORDS AS OUTLINED BELOW EMP NO LEVEL NEXTINCREASE WAGETYPE UNIT 1000 1 0 1000 1000 1 0 1002 ...
78
by: wkehowski | last post by:
The python code below generates a cartesian product subject to any logical combination of wildcard exclusions. For example, suppose I want to generate a cartesian product S^n, n>=3, of that...
17
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
4
by: ashasivan | last post by:
Hi, Please help me as soon as possible for the following problem. It is very very urgent. I have an XML file as follows: <?xml version="1.0" standalone="yes"?> <Employee> <em...
1
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.