pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSELECT with LEFT OUTER JOIN ON
3+ messages / 2 participants
[nested] [flat]
* SELECT with LEFT OUTER JOIN ON
@ 2002-02-19 10:00 Laurent Patureau <lpatureau@idfr.net>
2002-02-19 11:06 ` Re: SELECT with LEFT OUTER JOIN ON Luis Sousa <llsousa@ualg.pt>
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Patureau @ 2002-02-19 10:00 UTC (permalink / raw)
To: pgsql-sql
<html>
<br>
Hi,<br>
my query is :<br><br>
CREATE VIEW "vue_formation" AS SELECT <br>
f.numero_formation, <br>
f.intitule_1 || ' ' || f.intitule_2 || ' ' || f.intitule_3 AS intitule,
<br>
f.convention, <br>
f.subvention, <br>
f.effectif_conv, <br>
f.eff_subv, <br>
f.rythme_1 || ' ' || f.rythme_2 || ' ' || f.rythme_3 AS rythme, <br>
f.duree_entreprise || ' ' || u.nom || ' ' || f.commentaire_duree AS
duree_entreprise, <br>
f.public_1 || ' ' || f.public_2 || ' ' || f.public_3 AS public, <br>
f.admission_1 AS admission_1, <br>
f.admission_2 || ' ' || f.admission_3 AS admission_2, <br>
f.unknown_3 AS ref_admission, <br>
f.statut AS statut, <br>
f.duree_totale || ' '|| u1.nom AS duree_totale <br>
FROM formation f, ref_unite_de_duree u, ref_unite_de_duree u1<br>
LEFT OUTER JOIN ON (f.unite_duree_entreprise=u.id <br>
AND f.unite_duree_totale=u1.id) <br>
ORDER BY intitule<br><br>
There's a mistake near the ON, I don't find any example using join
condition on postgres.org/idocs<br>
Is anybody could help me (correct syntax or link with example).<br>
I find the doc on it not really complete.<br><br>
rgds,<br><br>
<br><br>
<x-sigsep><p></x-sigsep>
Laurent Patureau.<br>
____________________________________<br>
<font size=2>
Laurent Patureau<br>
</font><font size=1>S.A.R.L.</font><font size=2> ID.fr<br><br>
<a href="mailto:lpatureau@idfr.net" eudora="autourl">mailto:lpatureau@idfr.net</a><br><br>
<a href="http://www.idfr.net/"; eudora="autourl">http://www.idfr.net</a><br><br;
Porter un nouveau regard à votre audience :<br>
<a href="http://www.wysistat.com/"; eudora="autourl">http://www.wysistat.com</a><br><br;
Tel : 03 81 48 03 13<br>
Fax : 03 81 48 04 83<br><br>
16,
Boulevard Winston Churchill<br>
25 000 Besançon<br>
___________________________________</font></html>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: SELECT with LEFT OUTER JOIN ON
2002-02-19 10:00 SELECT with LEFT OUTER JOIN ON Laurent Patureau <lpatureau@idfr.net>
@ 2002-02-19 11:06 ` Luis Sousa <llsousa@ualg.pt>
2002-02-19 12:20 ` Re: SELECT with LEFT OUTER JOIN ON Luis Sousa <llsousa@ualg.pt>
0 siblings, 1 reply; 3+ messages in thread
From: Luis Sousa @ 2002-02-19 11:06 UTC (permalink / raw)
To: Laurent Patureau <lpatureau@idfr.net>; +Cc: pgsql-sql
Instead of:
FROM formation f, ref_unite_de_duree u, ref_unite_de_duree u1
LEFT OUTER JOIN ON (f.unite_duree_entreprise=u.id
AND f.unite_duree_totale=u1.id)
try:
FROM formation f LEFT OUTER JOIN ref_unite_de_duree u ON
(f.unite_duree_entreprise=u.id)
LEFT OUTER JOIN ref_unite_de_duree u1 ON
(f.unite_duree_entreprise=u1.id)
I don't know if the results are that you expect but the sintax, I think
is correct !
Best regards, Luis Sousa
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: SELECT with LEFT OUTER JOIN ON
2002-02-19 10:00 SELECT with LEFT OUTER JOIN ON Laurent Patureau <lpatureau@idfr.net>
2002-02-19 11:06 ` Re: SELECT with LEFT OUTER JOIN ON Luis Sousa <llsousa@ualg.pt>
@ 2002-02-19 12:20 ` Luis Sousa <llsousa@ualg.pt>
0 siblings, 0 replies; 3+ messages in thread
From: Luis Sousa @ 2002-02-19 12:20 UTC (permalink / raw)
To: ; +Cc: Laurent Patureau <lpatureau@idfr.net>; pgsql-sql
Luis Sousa wrote:
> Instead of:
>
> FROM formation f, ref_unite_de_duree u, ref_unite_de_duree u1
> LEFT OUTER JOIN ON (f.unite_duree_entreprise=u.id
> AND f.unite_duree_totale=u1.id)
>
> try:
>
> FROM formation f LEFT OUTER JOIN ref_unite_de_duree u ON
> (f.unite_duree_entreprise=u.id)
> LEFT OUTER JOIN ref_unite_de_duree u1 ON
> (f.unite_duree_entreprise=u1.id)
>
> I don't know if the results are that you expect but the sintax, I
> think is correct !
>
> Best regards, Luis Sousa
>
Sorry, correction:
try:
FROM formation f LEFT OUTER JOIN ref_unite_de_duree u ON
(f.unite_duree_entreprise) = (u.id)
LEFT OUTER JOIN ref_unite_de_duree u1 ON
(f.unite_duree_entreprise) =(u1.id)
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-02-19 12:20 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-19 10:00 SELECT with LEFT OUTER JOIN ON Laurent Patureau <lpatureau@idfr.net>
2002-02-19 11:06 ` Luis Sousa <llsousa@ualg.pt>
2002-02-19 12:20 ` Luis Sousa <llsousa@ualg.pt>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox