Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Stefan Schwarzer
You may also wish to review Andreas' suggestions as they propose a more sensible table structure rather than having a table for each convention. The table proposal really looks nice. But our database is structured by variable - so each convention has its own table. It is a really bad design -

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread A. Kretschmer
In response to A. Kretschmer : > In response to Thom Brown : > > On 23 February 2010 13:43, Stefan Schwarzer > > wrote: > > Select countries.name, basel.year, basel.value, cites.year, cites.value > > From countries > > Left Join basel on basel.id_country = countries.id_country and >

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread A. Kretschmer
In response to Thom Brown : > On 23 February 2010 13:43, Stefan Schwarzer > wrote: > Select countries.name, basel.year, basel.value, cites.year, cites.value > From countries > Left Join basel on basel.id_country = countries.id_country and > basel.value=1 > Left Join cites

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Stefan Schwarzer
Select countries.name, basel.year, basel.value, cites.year, cites.value From countries Left Join basel on basel.id_country = countries.id_country and basel.value=1 Left Join cites on cites.id_country = countries.id_country and cites.value=1 I would have thought so, but the query turns forever.

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread A. Kretschmer
In response to Stefan Schwarzer : > >You may also wish to review Andreas' suggestions as they propose a > >more sensible table structure rather than having a table for each > >convention. > > The table proposal really looks nice. But our database is structured > by variable - so each convention

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Thom Brown
On 23 February 2010 13:43, Stefan Schwarzer wrote: Select countries.name, basel.year, basel.value, cites.year, cites.value From countries Left Join basel on basel.id_country = countries.id_country and basel.value=1 Left Join cites on cites.id_country = countries.id_country

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Stefan Schwarzer
Select countries.name, basel.year, basel.value, cites.year, cites.value From countries Left Join basel on basel.id_country = countries.id_country and basel.value=1 Left Join cites on cites.id_country = countries.id_country and cites.value=1 I would have thought so, but the query turns forever.

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Thom Brown
On 23 February 2010 13:23, Stefan Schwarzer wrote: >> Select countries.name, basel.year, basel.value, cites.year, cites.value >> From countries >> Left Join basel on basel.id_country = countries.id_country and >> basel.value=1 >> Left Join cites on cites.id_country = countries.id_country and >> ci

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Stefan Schwarzer
Select countries.name, basel.year, basel.value, cites.year, cites.value From countries Left Join basel on basel.id_country = countries.id_country and basel.value=1 Left Join cites on cites.id_country = countries.id_country and cites.value=1 I would have thought so, but the query turns fore

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread A. Kretschmer
In response to Stefan Schwarzer : > Hi there, > > gush, shouldn't be that complicated. But neither in Postgres, nor in Access I > succeed in getting the result I wish. > > I have a couple of times for the Environmental Conventions (Kyoto, Montreal, > CITES etc.). They look like this: > > id_coun

Re: [GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Thom Brown
On 23 February 2010 11:44, Stefan Schwarzer wrote: > Hi there, > gush, shouldn't be that complicated. But neither in Postgres, nor in Access > I succeed in getting the result I wish. > I have a couple of times for the Environmental Conventions (Kyoto, Montreal, > CITES etc.). They look like this:

[GENERAL] Subqueries or Joins? Problems with multiple table query

2010-02-23 Thread Stefan Schwarzer
Hi there, gush, shouldn't be that complicated. But neither in Postgres, nor in Access I succeed in getting the result I wish. I have a couple of times for the Environmental Conventions (Kyoto, Montreal, CITES etc.). They look like this: id_country,year,value 4,1992,0 4,1993,0 4,1994,0 4,1