[Zope] ZBabel translation to Postgres

Phil Harris phil.harris@zope.co.uk
Thu, 4 Jan 2001 10:38:30 -0000


Olaf,

The left join is a notation that says to get all records from the left hand
side of the join and only those records where the criteria matches from the
right hand side.

It is btw a part of most RDBMS engines I've ever used, so it's not that
unusual a syntax.

You can also do something similar by using unions.

hth

Phil
phil.harris@zope.co.uk

----- Original Message -----
From: "Olaf Zanger" <olaf.zanger@soli-con.com>
To: "Zope Mailinglist" <zope@zope.org>
Cc: <akm@theinternet.com.au>
Sent: Thursday, January 04, 2001 9:50 AM
Subject: [Zope] ZBabel translation to Postgres


> Hi there,
>
> i'm using ZPyGreSQL successfully for my database. To keep it simple i
> don't want to use MySQL for ZBabel.
>
> ZBabel though uses some MySQL specific syntax which i am unsuccessfully
> translating to PostgreSQL syntax:
> Description "md5Hash" are the same fore entries with different "lang"
> fields. They are used to translate depending on selected language.
>
> SELECT
> Phrases.*
>
> FROM
> Phrases
>
> LEFT JOIN
> Phrases as b
>
> ON
> Phrases.md5Hash = b.md5Hash AND Phrases.lang <> b.lang
>
> WHERE
> b.md5Hash is NULL AND Phrases.lang=<dtml-sqlvar srcLang type=nb>
>
> What does the whole thing do anyway?
> How can you join "Phrases.md5Hash = b.mdf5Hash", while "md5Hash is
> NULL"?
> What is different in the LEFT JOIN ... ON ... statement to a normal
> WHERE clause?
> My try for translation to PostgreSQL (which I assume is completely
> ignorant):
>
> SELECT
> Phrases.*
>
> FROM
> Phrases as b
>
> WHERE
> Phrases.md5Hash *= b.md5Hash AND Phrases.lang <> b.lang AND
>
> b.md5Hash is NULL AND Phrases.lang=<dtml-sqlvar srcLang type=nb>
>
>
> Has anybody ported ZBabel already?
> Thanks for help
>
> Olaf
>
> --
> soli-con Engineering Zanger
> Dipl.-Ing. (FH) Olaf Marc Zanger
> Lorrainestrasse 23
> 3013 Bern / Switzerland
> Fon: +41-31-332 9782
> Mob: +41-76-572 9782
> mailto:info@soli-con.com
> mailto:olaf.zanger@soli-con.com
> http://www.soli-con.com