Re: Inner Join? - Mailing list pgsql-general

From Tom Lane
Subject Re: Inner Join?
Date
Msg-id 16372.994807928@sss.pgh.pa.us
Whole thread Raw
In response to Inner Join?  (jeff@emojo.com (Jeff Rhys-Jones))
List pgsql-general
jeff@emojo.com (Jeff Rhys-Jones) writes:
> Hi there - we've hit a bit of a brick wall with this and I was
> wondering if someone could help us out. Our MS-SQL code is this :

> SELECT ...
>     FROM "Site","AppUser"
>     WHERE "Site"."SiteCode"=1
>         AND "Site"."SecurityContactCode" *= "AppUser"."UserCode"

> And it's the "* =" at the very end of the table which is causing the
> problem.

> Our dev. guy has told me that "*=" in MS speak is INNER JOIN.

I believe it's actually an outer join; inner join is the standard and
wouldn't need any special syntax.  You probably want

SELECT ...
    FROM "Site" LEFT OUTER JOIN "AppUser" ON
        ("Site"."SecurityContactCode" = "AppUser"."UserCode")
    WHERE "Site"."SiteCode"=1

assuming that I've guessed right...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bad news for Open Source databases, acording to survey
Next
From: "Mikheev, Vadim"
Date:
Subject: RE: Re: MVCC article