Subject | Re: [firebird-support] Is possible to have a computed column using a column of another table? |
---|---|
Author | W O |
Post date | 2011-08-01T02:20:15Z |
Excellent, Markus
IT WORKS!!!
Thank you very much.
Walter.
IT WORKS!!!
Thank you very much.
Walter.
On Sun, Jul 31, 2011 at 9:49 PM, Markus Ostenried <macnoz@...>wrote:
> **
>
>
> On Mon, Aug 1, 2011 at 02:39, W O <sistemas2000profesional@...>
> wrote:
> > Hello everybody
> >
> > - I have a table called CAB
> > - CAB has a primary key on column ID_CAB
> > - I have a table called DET
> > - DET has a foreign key to the column ID_CAB of CAB
> > - Now, I want to have a computed column in DET, using a column of DET and
> a
> > column of CAB, something as: TOTALX is CAB.COUNT * DET.PRICE
> > - But I cannot do that, the message "column unknown" is showed.
> >
> > There is some way to do that?
>
> Hi, try something like
>
> alter table det
> add totalx computed by ((
> select c.count * det.price
> from cab c
> where c.id_cab = det.id_cab
> ));
>
> HTH,
> Markus
>
>
>
[Non-text portions of this message have been removed]