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

Home -> Community -> Usenet -> c.d.o.misc -> Unnecessary fields when using select on several tables.

Unnecessary fields when using select on several tables.

From: IB <Ismael.BALLO_at_NOSPAMcern.ch>
Date: Mon, 17 Sep 2001 15:10:05 +0200
Message-ID: <3BA5F62D.2728B1A@NOSPAMcern.ch>


Hi,

I've 3 tables with the fields given below

GLOBINFO
serialn, commande,arrival, brand,modele, comment

RMA_Envoi
serialn,date_sent,expdtn

RMA_Recept
serialn,date_arrived,livraisn,serialn_replaced

I want to do a query on these 3 tables with these given fields

serialn, commande,arrival, brand,modele, commentaire,date_sent,expdtn,date_arrived,livraisn,serialn_replaced

select serialn, commande,arrival, brand,modele, commentaire,date_sent,expdtn,date_arrived,livraisn,serialn_replaced from globinfo rma_envoi,rma_recept
where req[j]

(1) with req[j]="(globinfo.serialn NOT IN (select serialn from
rma_recept) AND globinfo.serialn NOT IN
(select serialn from rma_envoi))";
(2) req[j]+=" OR globinfo.serialn=rma_recept.serialn AND
globinfo.serialn NOT IN ( select serialn from rma_envoi)";
(3) req[j]+=" OR globinfo.serialn=rma_recept.serialn AND
rma_envoi.date_envoi <
rma_recept.date_arriv";

In fact, I want all the header fields in output even if there are not taken into account in one of this 3
part-query : it will give me blank..
Example in (1), I don't need the fields from rma_recept or rma_envoi for this query but I need to do just
one sql query from these 3 tables : the reason of my question.

I asked myself about the possibility to use create table but I don't know exactly the syntax where U use
several tables ..
If someone could enlighten me..
Thanks in advance. Received on Mon Sep 17 2001 - 08:10:05 CDT

Original text of this message

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