Re: BUG #2553: Outer join bug - Mailing list pgsql-bugs

From Michael Fuhr
Subject Re: BUG #2553: Outer join bug
Date
Msg-id 20060728155231.GA95933@winnie.fuhr.org
Whole thread Raw
In response to BUG #2553: Outer join bug  ("Steven Adams" <swadams3@comcast.net>)
List pgsql-bugs
[Please copy the mailing list on replies so others can participate
in and learn from the discussion.]

On Fri, Jul 28, 2006 at 09:54:42AM -0500, Steven Adams wrote:
> I wanted the row to show whether or not there was a matching row in the
> other table, but I wanted to return exactly 1 row.

As Tom Lane already pointed out, you're probably needing a WHERE
clause.  Does this do what you want?

SELECT ia.name, iac.internal
FROM information_assets AS ia
LEFT OUTER JOIN information_asset_categories AS iac ON ia.category_id = iac.id
WHERE ia.id = 21;

--
Michael Fuhr

pgsql-bugs by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Query returned unhandled type 16411
Next
From: Martin Pitt
Date:
Subject: Fwd: Bug#380047: libpq-dev: no declaration for pg_encoding_to_char