Lists: | pgsql-sql |
---|
From: | Doris Bernloehr <bedo7(at)gmx(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | SQL Syntax problem |
Date: | 2003-09-28 12:43:09 |
Message-ID: | 200309281443.09936.bedo7@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | 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
From: | Franco Bruno Borghesi <franco(at)akyasociados(dot)com(dot)ar> |
---|---|
To: | Doris Bernloehr <bedo7(at)gmx(dot)net> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: SQL Syntax problem |
Date: | 2003-09-29 18:08:21 |
Message-ID: | 1064858901.1509.1.camel@taz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | 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
>
From: | sad <sad(at)bankir(dot)ru> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: SQL Syntax problem |
Date: | 2003-09-30 05:22:06 |
Message-ID: | 200309300922.06402.sad@bankir.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | 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?...)
From: | Gaetano Mendola <mendola(at)bigfoot(dot)com> |
---|---|
To: | "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Cc: | sad <sad(at)bankir(dot)ru> |
Subject: | Re: SQL Syntax problem |
Date: | 2003-09-30 07:52:51 |
Message-ID: | 3F793653.3070300@bigfoot.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-sql |
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
From: | pginfo <pginfo(at)t1(dot)unisoftbg(dot)com> |
---|---|
To: | Doris Bernloehr <bedo7(at)gmx(dot)net> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: SQL Syntax problem |
Date: | 2003-09-30 10:23:55 |
Message-ID: | 3F7959BB.3A24C03@t1.unisoftbg.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | 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