Sunday, February 19, 2012

Help me create a SQL Statement

I have a database that is far from being rational! I need to query the tables to get a hierarchy resultset.
Here is the structure:
levelOne
levelOne_A
levelTwo
levelThree
levelFour
my problem is that table levelOne_A and table levelTwo have data that are considered to fall underneath levelOne. However the data is far different from each other so I can not able merge both into one.
so the it should look like this:
levelOne
levelOne_A AND levelTwo
levelThree
levelFour

Any ideas how I can get my hierarchy structure?
Thanks for your help!

I am not following you at all. Are levelOne, levelOne_A, etc.,tables in your database? Are they columns in a table? Arethey pieces of data? Could you explain further? Can youprovide some data examples? And could you use a non-spaced font(like courier) to make sure the hierachy you need is accuratelyrepresented?

No comments:

Post a Comment