| От | Raymond O'Donnell |
|---|---|
| Тема | Re: What is *wrong* with this query??? |
| Дата | |
| Msg-id | 4EB59006.4070209@iol.ie обсуждение исходный текст |
| Ответ на | What is *wrong* with this query??? (Steve Murphy <smurphy@intorrent.com>) |
| Список | pgsql-general |
On 05/11/2011 04:51, Steve Murphy wrote: > select schedule.id as sched_id, bld.id as bid > from > schedule > left join company on schedule.company = company.id > left join (select * from building where building.company = > company.id order by id limit 1) as bld > where > schedule.status = 'active' and company.status = 'active' and > bld.status = 'active'; You're missing the "on" bit after the join, and I think an alias for the inline view also: ...left join (....) x on (schedule.whatever = x.whatever) BTW it's a good idea to use explicit column names, not "select *" - makes for easier bug-finding. Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера