Re: [SQL] Order of items in FROM causes error?

2005-04-01 Thread Tom Lane
Rosser Schwarz <[EMAIL PROTECTED]> writes: > A colleague has the following query, which errors with: relation "dl" > does not exist. (See the second item in the FROM clause.) If that > item is moved to immediately precede the first JOIN item however, the > query works as expected. > select u.use

Re: [SQL] Order of items in FROM causes error?

2005-04-01 Thread Stephan Szabo
On Fri, 1 Apr 2005, Rosser Schwarz wrote: > A colleague has the following query, which errors with: relation "dl" > does not exist. (See the second item in the FROM clause.) If that > item is moved to immediately precede the first JOIN item however, the > query works as expected. > > select u.u

[SQL] Order of items in FROM causes error?

2005-04-01 Thread Rosser Schwarz
A colleague has the following query, which errors with: relation "dl" does not exist. (See the second item in the FROM clause.) If that item is moved to immediately precede the first JOIN item however, the query works as expected. select u.usersfirstname || ' ' || u.userslastname as userssuperv

Re: [SQL] Speed up slow select - was gone blind

2005-04-01 Thread Richard Huxton
Gary Stainburn wrote: Hi folks. I've got my select working now, but I haven't received the speed increase I'd expected. It replaced an earlier select which combined a single explicit join with multiple froms. The first select is the old one, the second one is the new one (with a new join).

Re: [SQL] Speed up slow select - was gone blind

2005-04-01 Thread Dinesh Pandey
Try with creating INDEX on the used tables...It will make your search query faster. Thanks Dinesh Pandey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gary Stainburn Sent: Friday, April 01, 2005 6:03 PM To: pgsql-sql@postgresql.org Subject: [SQL] Spee

Re: [SQL] Speed up slow select - was gone blind

2005-04-01 Thread Mike Rylander
Can you send the EXPLAIN ANALYZE of each? We can't really tell where the slowdown is without that. On Apr 1, 2005 12:32 PM, Gary Stainburn <[EMAIL PROTECTED]> wrote: > Hi folks. > > I've got my select working now, but I haven't received the speed > increase I'd expected. It replaced an earlier

[SQL] Speed up slow select - was gone blind

2005-04-01 Thread Gary Stainburn
Hi folks. I've got my select working now, but I haven't received the speed increase I'd expected. It replaced an earlier select which combined a single explicit join with multiple froms. The first select is the old one, the second one is the new one (with a new join). The new one takes 24

Re: [SQL] gone blind - can't see syntax error

2005-04-01 Thread Gary Stainburn
On Friday 01 April 2005 1:01 pm, you wrote: > On Friday 01 Apr 2005 5:06 pm, Gary Stainburn wrote: > > Hi folks. > > > > I've been looking at this for 10 minutes and can't see what's > > wrong. Anyone care to enlighten me. > > comma after 'r'? I'd only just added that comma, to try to fix it. Tha

Re: [SQL] gone blind - can't see syntax error

2005-04-01 Thread Kenneth Gonsalves
On Friday 01 Apr 2005 5:06 pm, Gary Stainburn wrote: > Hi folks. > > I've been looking at this for 10 minutes and can't see what's > wrong. Anyone care to enlighten me. comma after 'r'? -- regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.sourceforge.net àà à!

Re: [SQL] gone blind - can't see syntax error

2005-04-01 Thread Mike Rylander
On Apr 1, 2005 11:36 AM, Gary Stainburn <[EMAIL PROTECTED]> wrote: > Hi folks. > > I've been looking at this for 10 minutes and can't see what's wrong. > Anyone care to enlighten me. > > Thanks > > Gary > > [EMAIL PROTECTED] webroot]# psql -a -f new-view.sql > SELECT r.r_id, r.r_registration, r

Re: [SQL] gone blind - can't see syntax error

2005-04-01 Thread Dinesh Pandey
Try this FROM requests r left outer join users sm on sm.u_id = r.r_salesman left outer join users u on r.r_u_id = u.u_id left outer join request_types t on r.r_t_id = t.t_id left outer join request_states s on r.r_s_id = s.s_id left outer join dealerships d on r.r_d_id = d.d_id left outer join de

[SQL] gone blind - can't see syntax error

2005-04-01 Thread Gary Stainburn
Hi folks. I've been looking at this for 10 minutes and can't see what's wrong. Anyone care to enlighten me. Thanks Gary [EMAIL PROTECTED] webroot]# psql -a -f new-view.sql SELECT r.r_id, r.r_registration, r.r_chassis, r.r_vehicle, r.r_fuel, r.r_pack_mats, r.r_delivery, (date(r.r_deli