Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Unnecessary fields when using select on several tables.
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