Re: [SQL] Problem with JOINS

2004-05-21 Thread Tom Lane
Charlie Clark <[EMAIL PROTECTED]> writes: > WHERE true > AND > person.id_status = 2 > AND > person.id_authorise = 2 > AND > ltrim(lower(address.ort)) like lower('Neuss%') > AND > bs.value = 'bezahlt' OR bs.value = 'erlassen' > AND > users.roles like '%Premium' AND binds more tightly than OR --- I

Re: [SQL] Problem with JOINS

2004-05-21 Thread Stephan Szabo
On Fri, 21 May 2004, Charlie Clark wrote: > SELECT > gender.value as anrede_value, > person.name as person_name, > person.vorname as person_vorname, > person.zusatz as person_zusatz, > person.birthdate as person_birthdate, > address.strasse as address_strasse, > address.hausnummer as address_hau

[SQL] Problem with JOINS

2004-05-21 Thread Charlie Clark
Dear list, I've recently noticed that I've got a problem with query. It seems that due to some of the conditions I'm setting an implicit OUTER JOIN is occuring which is overriding another condition. I'm enclosing two queries. The first returns a list of people in a particular cities, the secon

Re: [SQL] Problem with joins

2000-07-05 Thread Thomas Lockhart
> I want to get a list of data sources with the corresponding data, > if the data exists, or with null, if the data doesn't. But anyway > I need the data sources (all of them). You want an outer join. Postgres doesn't have that yet, but you can mimic it. > I have also tried: > select source_nam

Re: Antw: [SQL] Problem with joins

2000-07-05 Thread Jean-Marc Libs
On Wed, 5 Jul 2000, Gerhard Dieringer wrote: > Jean-Marc Libs wrote: > >... > >I have also tried: > >select source_name,data_value from source,data where data_source_id=source_id union >select source_name,source_id,NULL from source,data > > >This is a bit better, in the sense that I get back al

Antw: [SQL] Problem with joins

2000-07-05 Thread Gerhard Dieringer
Jean-Marc Libs wrote: >... >I have also tried: >select source_name,data_value from source,data where data_source_id=source_id union >select source_name,source_id,NULL from source,data >This is a bit better, in the sense that I get back all I need, but there >are too many lines: when there is da

[SQL] Problem with joins

2000-07-05 Thread Jean-Marc Libs
Hi all, I am trying to do something unusual (for me) and I can't quite find the relevant part in the documentation (no mention to joins in the insert section, or the index). I want to get a list of data sources with the corresponding data, if the data exists, or with null, if the data doesn't. B