Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Help with table design (easy?)

Re: Help with table design (easy?)

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 14 Apr 2001 13:42:50 +0200
Message-ID: <5qdgdt40a40rq821fhghcaapklvt1p3ghr@4ax.com>

On Thu, 12 Apr 2001 08:21:04 -0600, "Sean Dolan" <nospam_at_nowhere.com> wrote:

>Oracle 8.1.7 platform.
>
>I have a table called SYS_GROUPS that has a primary key of the groupname as
>shown below:
>
>GrpName
>--------------
>Descr
>
>A group can have control over other groups. How do I build a table to
>represent that? I thougha circular reference via a FK to grpName would work
>but that only allows control over 1 group. I basically need a many to many
>relationship, but how can I build a table that looks like:
>
>GrpName
>GrpName
>---------------
>
>You can't have the same column name twice. Any ideas?
>
>Thank you.
>Sean
>

Just include a foreign key column in SYS_GROUPS pointing to the already existing primary key and give it whatever name (MasterGrpName or something like that)
You'll going to need the connect by clause to display your data in hierarchical fashion.

Hth,

Sybrand Bakker, Oracle DBA Received on Sat Apr 14 2001 - 06:42:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US