pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSQL Syntax problem
5+ messages / 5 participants
[nested] [flat]
* SQL Syntax problem
@ 2003-09-28 12:43 Doris Bernloehr <bedo7@gmx.net>
2003-09-29 18:08 ` Re: SQL Syntax problem Franco Bruno Borghesi <franco@akyasociados.com.ar>
2003-09-30 05:22 ` Re: SQL Syntax problem sad <sad@bankir.ru>
2003-09-30 10:23 ` Re: SQL Syntax problem pginfo <pginfo@t1.unisoftbg.com>
0 siblings, 3 replies; 5+ messages in thread
From: Doris Bernloehr @ 2003-09-28 12:43 UTC (permalink / raw)
To: pgsql-sql
Hello.
I've got a problem in porting the following select statement from Oracle to
Postgres, because of the characters after "b.bet_id" and "f.ask_id" in the
where clause: (+)
I don't know what these characters mean and how I can transform these into
PostgreSql Syntax.
select ...
from auswahlkatalog k, anspruchkorrektur a, beteiligter b, v_betkorr f
where k.awk_id = a.awk_id and b.bet_id(+) = a.bet_idemp
and a.ask_id = f.ask_id(+);
Hoping for help.
Doris
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SQL Syntax problem
2003-09-28 12:43 SQL Syntax problem Doris Bernloehr <bedo7@gmx.net>
@ 2003-09-29 18:08 ` Franco Bruno Borghesi <franco@akyasociados.com.ar>
2 siblings, 0 replies; 5+ messages in thread
From: Franco Bruno Borghesi @ 2003-09-29 18:08 UTC (permalink / raw)
To: Doris Bernloehr <bedo7@gmx.net>; +Cc: pgsql-sql
This kind of conditions are left or right joins, depending on which side
of the equal sign you have the (+).
Something like this
select ...
from
auswahlkatalog k,
INNER JOIN anspruchkorrektur a ON (k.awk_id = a.awk_id),
LEFT JOIN beteiligter b ON (b.bet_id = a.bet_idemp),
RIGHT JOIN v_betkorr f ON (a.ask_id = f.ask_id)
should give you the same results.
On Sun, 2003-09-28 at 09:43, Doris Bernloehr wrote:
> Hello.
>
> I've got a problem in porting the following select statement from Oracle to
> Postgres, because of the characters after "b.bet_id" and "f.ask_id" in the
> where clause: (+)
> I don't know what these characters mean and how I can transform these into
> PostgreSql Syntax.
>
>
> select ...
> from auswahlkatalog k, anspruchkorrektur a, beteiligter b, v_betkorr f
> where k.awk_id = a.awk_id and b.bet_id(+) = a.bet_idemp
> and a.ask_id = f.ask_id(+);
>
>
> Hoping for help.
> Doris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
Attachments:
signature.asc (application/pgp-signature, 186B) download
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SQL Syntax problem
2003-09-28 12:43 SQL Syntax problem Doris Bernloehr <bedo7@gmx.net>
@ 2003-09-30 05:22 ` sad <sad@bankir.ru>
2003-09-30 07:52 ` Re: SQL Syntax problem Gaetano Mendola <mendola@bigfoot.com>
2 siblings, 1 reply; 5+ messages in thread
From: sad @ 2003-09-30 05:22 UTC (permalink / raw)
To: pgsql-sql
> I've got a problem in porting the following select statement from Oracle to
> Postgres, because of the characters after "b.bet_id" and "f.ask_id" in the
> where clause: (+)
> I don't know what these characters mean and how I can transform these into
> PostgreSql Syntax.
>
>
> select ...
> from auswahlkatalog k, anspruchkorrektur a, beteiligter b, v_betkorr f
> where k.awk_id = a.awk_id and b.bet_id(+) = a.bet_idemp
> and a.ask_id = f.ask_id(+)
This (+) means JOIN
e.g. (+)-marked equations used as a joining condition
To translate it to PGSQL syntax simply remove (+)
:-)
(only one thing i forgot: isn't it OUTER JOIN?...)
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SQL Syntax problem
2003-09-28 12:43 SQL Syntax problem Doris Bernloehr <bedo7@gmx.net>
2003-09-30 05:22 ` Re: SQL Syntax problem sad <sad@bankir.ru>
@ 2003-09-30 07:52 ` Gaetano Mendola <mendola@bigfoot.com>
0 siblings, 0 replies; 5+ messages in thread
From: Gaetano Mendola @ 2003-09-30 07:52 UTC (permalink / raw)
To: pgsql-sql; +Cc: sad <sad@bankir.ru>
sad wrote:
>>select ...
>>from auswahlkatalog k, anspruchkorrektur a, beteiligter b, v_betkorr f
>>where k.awk_id = a.awk_id and b.bet_id(+) = a.bet_idemp
>> and a.ask_id = f.ask_id(+)
>
>
> This (+) means JOIN
Means OUTER JOIN but I don't remember the side.
> e.g. (+)-marked equations used as a joining condition
Not exactly see above
Regards
Gaetano Mendola
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SQL Syntax problem
2003-09-28 12:43 SQL Syntax problem Doris Bernloehr <bedo7@gmx.net>
@ 2003-09-30 10:23 ` pginfo <pginfo@t1.unisoftbg.com>
2 siblings, 0 replies; 5+ messages in thread
From: pginfo @ 2003-09-30 10:23 UTC (permalink / raw)
To: Doris Bernloehr <bedo7@gmx.net>; +Cc: pgsql-sql
Hi Doris,
In oracle (+) is left outer join or right outer join .
You need to write:
select ...
from auswahlkatalog k, beteiligter b left outer join anspruchkorrektur a
on(b.bet_id = a.bet_idemp) left outer join v_betkorr f on (a.ask_id = f.ask_id)
where k.awk_id = a.awk_id ;
regards,
ivan.
Doris Bernloehr wrote:
> Hello.
>
> I've got a problem in porting the following select statement from Oracle to
> Postgres, because of the characters after "b.bet_id" and "f.ask_id" in the
> where clause: (+)
> I don't know what these characters mean and how I can transform these into
> PostgreSql Syntax.
>
> select ...
> from auswahlkatalog k, anspruchkorrektur a, beteiligter b, v_betkorr f
> where k.awk_id = a.awk_id and b.bet_id(+) = a.bet_idemp
> and a.ask_id = f.ask_id(+);
>
> Hoping for help.
> Doris
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2003-09-30 10:23 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-28 12:43 SQL Syntax problem Doris Bernloehr <bedo7@gmx.net>
2003-09-29 18:08 ` Franco Bruno Borghesi <franco@akyasociados.com.ar>
2003-09-30 05:22 ` sad <sad@bankir.ru>
2003-09-30 07:52 ` Gaetano Mendola <mendola@bigfoot.com>
2003-09-30 10:23 ` pginfo <pginfo@t1.unisoftbg.com>
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