Re: Creating a report from 3 tables
Posted in 2000
Topics: Server Administration, Triggers, Constraints & Referential Integrity
From: elizabeth1000@my-deja.com
>
>I am an Oracle DBA who's been put in charge of a Informix database (all
>databases are alike right?) Anyway I have to immediately generate a
>report that takes columns from 3 different tables.
>
>From Table A we need user and code (it has a 3rd column FK question_id)
>these need to be selected where the completed column is not null
>
>From Table B we need question_id and text where question_id matches the
>question_id of the not null completeds returned above
>
>Table 3 answer_text (where question_id matches question_id above)
SELECT a.user, a.code, b.question_id, b.text, c.answer_text
FROM a, b, c
WHERE a.question_id = b.question_id
AND c.question_id = b.question_id
AND a.completed IS NOT NULL
?
>I've written this and run it on an Oracle database, I've pulled it into
>a temporary table and pulled the report from there and also created an
>on update trigger that populates a holding table. But nothing I do in
>Informix seems to work, I can't even get past syntax errors, could
>someone please point me in the right direction?
>
>Thank
>
>Lizzy
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
Obnoxio The Clown wrote:
>
> From: elizabeth1000@my-deja.com
> >
> >I am an Oracle DBA who's been put in charge of a Informix database (all
> >databases are alike right?) Anyway I have to immediately generate a
> >report that takes columns from 3 different tables.
> >
> >From Table A we need user and code (it has a 3rd column FK question_id)
> >these need to be selected where the completed column is not null
> >
> >From Table B we need question_id and text where question_id matches the
> >question_id of the not null completeds returned above
> >
> >Table 3 answer_text (where question_id matches question_id above)
>
> SELECT a.user, a.code, b.question_id, b.text, c.answer_text
> FROM a, b, c
> WHERE a.question_id = b.question_id
> AND c.question_id = b.question_id
> AND a.completed IS NOT NULL
Didn't I say that? I thought I said that! ;-p
Art S. Kagel
> >I've written this and run it on an Oracle database, I've pulled it into
> >a temporary table and pulled the report from there and also created an
> >on update trigger that populates a holding table. But nothing I do in
> >Informix seems to work, I can't even get past syntax errors, could
> >someone please point me in the right direction?
> >
> >Thank
> >
> >Lizzy
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Before you buy.
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com