Je dois interroger à partir de deux tables et je veux un résultat .. comment puis-je joindre ces deux requêtes?Joindre deux requêtes Oracle
La première requête interroge à partir de deux tables et la seconde n'en est qu'une.
select pt.id,pt.promorow,pt.promocolumn,pt.type,pt.image,pt.style,pt.quota_allowed,ptc.text,pq.quota_left
from promotables pt,promogroups pg ,promotablecontents ptc ,promoquotas pq where pt.id_promogroup = 1 and ptc.country ='049' and ptc.id_promotable = pt.id and pt.id_promogroup = pg.id and pq.id_promotable = pt.id order by pt.promorow,pt.promocolumn
select pt.id,pt.promorow,pt.promocolumn,pt.type,pt.image,pt.style,pt.quota_allowed from promotables pt where pt.type='heading'
Voulez-vous rejoindre les requêtes ou les concaténer? Cela signifie différentes choses en SQL. Une jointure implique généralement des critères de jointure ('select from a join b on a.col = b.col') alors que la concaténation consiste simplement à ajouter les résultats d'une requête à l'autre (par exemple via 'UNION' ou' UNION ALL'). –