Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: 1:c - relation in oracle
> Hi,
>
> can anybody tell me how a 1:c - relation (c is a fixed number, e.g.1:0, 1:1,
> 1:2, ..., 1:N) can be realized in Oracle?
>
> Thank you and best regards,
> Christian
Christian,
It makes me wonder what exactly you're after. That said, it is not possible (at least with Oracle) to build a say 1:3 relation between two tables, at least not in the traditional sense.
Yet, not all is lost.
Consider:
create table t_A (
a number primary key,
b Varchar2(20)
);
create table t_B (
c references t_A
d Varchar2(50)
);
Now, if you want a 1:3 relationship between t_A and t_B, then do it as follows
create table t_A1_B3 (
a number primary,
d1 Varchar2(50) not null, d2 Varchar2(50) not null, d3 Varchar2(50) not null
Then, you fill all three d's that would go into t_B into d1, d2, and d3, respectively.
hth,
Rene
-- Rene Nyffenegger http://www.adp-gmbh.chReceived on Tue Dec 23 2003 - 13:26:36 CST
![]() |
![]() |