Solved

create a hierarchial table structure

Posted on 2014-09-23
2
123 Views
Last Modified: 2014-09-24
I have a simple account table.  How do you create a hierarchial table structure for accounts that just goes 1 level deep?

So, you can have a parent account and then child accounts underneath the parent.

Thanks for any help.
Regards.
0
Comment
Question by:-Dman100-
2 Comments
 
LVL 6

Accepted Solution

by:
ianmills2002 earned 500 total points
ID: 40340770
Two options.

1. A 2nd Parent account table and all the accounts in the account table have a foreign key to link to the parent.

2. Keep them all in the same table and add a Parent Account column. When NULL, the account record is a parent, when NOT NULL, the account has a parent account.
0
 

Author Closing Comment

by:-Dman100-
ID: 40341663
Thank you!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question