| От | Tom Lane |
|---|---|
| Тема | Re: BUG #2553: Outer join bug |
| Дата | |
| Msg-id | 16007.1154058883@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | BUG #2553: Outer join bug ("Steven Adams" <swadams3@comcast.net>) |
| Список | pgsql-bugs |
"Steven Adams" <swadams3@comcast.net> writes:
> select ia.name, iac.internal
> from information_assets as ia
> left outer join information_asset_categories as iac on(ia.category_id =
> iac.id)
> and ia.id = 21
> This causes all rows in information_assets to be returned despite the "and"
> clause.
AFAICS that's correct behavior. I think you're confused about SQL
syntax: the way you've written it, the "ia.id = 21" condition is
part of the left join's ON clause, and therefore it cannot cause any
rows from the left side of the join to be omitted. (Hint: those
parentheses are just noise.) Perhaps you meant to write WHERE ia.id = 21?
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера