[GENERAL] What is *wrong* with this query???

2011-11-05 Thread Steve Murphy
I give! I'm flummoxed! Here is what I have, 3 tables: schedule companybuilding status0 3 x active 4 x active 5 x active 3 x active 3

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread David Johnston
See embedded note after “as bld” Dave From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Murphy Sent: Saturday, November 05, 2011 12:51 AM To: pgsql-general@postgresql.org Subject: [GENERAL] What is *wrong* with this query??? I

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread Adrian Klaver
On Friday, November 04, 2011 9:51:14 pm Steve Murphy wrote: I give! I'm flummoxed! Here is what I have, 3 tables: schedule companybuilding status0 3 x active 4 x active 5 x

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread Scott Marlowe
On Fri, Nov 4, 2011 at 10:51 PM, Steve Murphy smur...@intorrent.com 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

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread Tair Sabirgaliev
On Sat, Nov 5, 2011 at 10:51 AM, Steve Murphy smur...@intorrent.com wrote: I give! I'm flummoxed! Here is what I have, 3 tables: schedule company    building   status0 3 x   active 4 x   active 5 

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread Rodrigo Gonzalez
El 05/11/11 01:51, Steve Murphy escribió: I give! I'm flummoxed! Here is what I have, 3 tables: schedule companybuilding status0 3 x active 4 x active 5 x active 3

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread Raymond O'Donnell
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

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread Antonio Goméz Soto
Steve, Op 05-11-11 05:51, Steve Murphy schreef: I give! I'm flummoxed! Here is what I have, 3 tables: schedule company building status0 3 x active 4 x active 5 x active 3 x active 3 x active 3 x active In the end, I want to replace the building id's above. They start out with the