On 7/6/05, Ragnar HafstaĆ° <[EMAIL PROTECTED]> wrote:
> On Wed, 2005-07-06 at 11:33 +0100, Nick Stone wrote:
> > I've had exactly yhe same problem - try changing the query to.
> >
> > select count(*)
> > from h left join p using (r,pos) and p.r_order=1
> > where h.tn > 20
> > and h.tn < 30
>
> re
On Wed, 2005-07-06 at 11:33 +0100, Nick Stone wrote:
> I've had exactly yhe same problem - try changing the query to.
>
> select count(*)
> from h left join p using (r,pos) and p.r_order=1
> where h.tn > 20
> and h.tn < 30
really ? is this legal SQL ?
is this a 8.0 feature ?
I get syntax error
"Grant Morgan" <[EMAIL PROTECTED]> writes:
> select count(*)
> from h left join p using (r,pos)
> where h.tn > 20
> and h.tn < 30
> and p.r_order=1
> since it is a left join I though I should get a number no smaller in
> the left join than the original unjoined query. It seems to be acting
> lik
l@postgresql.org
Subject: [SQL] left joins
I am having a problem with left joins in Postgresql.(probably my
misunderstanding of left joins)
My first Query returns
70,000
select count(*)
from h
where h.tn > 20
and h.tn < 30
my left join
returns only 34,000
select count(*)
from h left join
aking it an inner join
Hope this helps
Nick
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Grant Morgan
Sent: 06 July 2005 11:02
To: pgsql-sql@postgresql.org
Subject: [SQL] left joins
I am having a problem with left joins in Postgresql.(probably my
misunder
Grant Morgan wrote:
I am having a problem with left joins in Postgresql.(probably my
misunderstanding of left joins)
My first Query returns
70,000
select count(*)
from h
where h.tn > 20
and h.tn < 30
my left join
returns only 34,000
select count(*)
from h left join p using (r,pos)
where h.
I am having a problem with left joins in Postgresql.(probably my
misunderstanding of left joins)
My first Query returns
70,000
select count(*)
from h
where h.tn > 20
and h.tn < 30
my left join
returns only 34,000
select count(*)
from h left join p using (r,pos)
where h.tn > 20
and h.tn < 30
n Fox" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 17, 2004 8:00 AM
Subject: [SQL] Left joins with multiple tables
> Hi, all.
>
> I've got a bit of a problem here. I have 4 tables - people, a, b, c (not
> the original names).
>
> For eac
On Sat, Jan 17, 2004 at 02:30:01AM +, Colin Fox wrote:
> For each person in the people table, they may or may not have a record in
> a, may or may not have a record in b, and may or may not have a record in
> c.
...
> But I'd like to be able to do something like:
>
> select
> id, name,
Hi, all.
I've got a bit of a problem here. I have 4 tables - people, a, b, c (not
the original names).
For each person in the people table, they may or may not have a record in
a, may or may not have a record in b, and may or may not have a record in
c.
Handling the first table (a) is easy:
sel
> I've got a nasty query that joins a table onto itself like 22 times.
> I'm wondering if there might be a better way to do this, and also how
> I can left join every additional table on the first one. By this I
> mean that if f1 matches my criteria and therefore isn't null, then
> every other joi
I've got a select that pulls many values from the same table.
Basicaly for a given formid there can be many fields each one
depending on a definition. So form1 may be broken down as follows:
fieldid
1 firstname
2 lasname
3 postal code
Rather than sticking this data in
12 matches
Mail list logo