Re: [SQL] delete from a using b in postgres 8.1.

2006-01-03 Thread Jaime Casanova
On 1/2/06, Peter Childs <[EMAIL PROTECTED]> wrote: > a command such as > > delete from a using b where a.one=b.one and b.two='foo'; > > works fine in 8.1 but fails totally in 8.0 however > > delete from a where a.one=b.one and b.two='foo'; > > works fine in 8.0 and bellow but fails in 8.1 unless yo

[SQL] getting a query column to return 0 if nothing matches

2006-01-03 Thread Dan Tenenbaum
I have a query like this (this one is simplified to illustrate my question): select     l.email, p.practice_name, count(lp.provider_key) as patient_count from     login l, provider p, login_provider lp where     p.login_key = l.id and     lp.provider_key = p.provider_key group by  

[SQL] Loading lots of data in a SQL command

2006-01-03 Thread frank church
I am load lots of data via SQL into a database and wrapping it into transactions speeds it up. However this fails a number of times. The queries results are logged so it is easy for me to find problem records. However a single failure causes the whole transaction to fail. Is there a setting or

Re: [SQL] getting a query column to return 0 if nothing matches

2006-01-03 Thread Michael Fuhr
On Tue, Jan 03, 2006 at 02:15:25PM -0800, Dan Tenenbaum wrote: > I want to show all rows where the first part of the WHERE clause is true, > regardless of whether the provider_key is in the login_provider table (in > that cause, I want to show 0 in that column). Sounds like you're looking for an o