Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

create a hierarchial table structure

Posted on 2014-09-23
2
Medium Priority
?
130 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-
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
ianmills2002 earned 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.

718 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