RE: SQL question regarding a couple of table joins.

From: "Edmar Wiggers" <edmar(at)brasmap(dot)com>
To: "Warren Vanichuk" <pyber(at)street-light(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: RE: SQL question regarding a couple of table joins.
Date: 2000-11-07 01:14:58
Message-ID: NEBBIAKDCDHFGJMLHCKIAEPPCAAA.edmar@brasmap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> SELECT
>
> links.linkid,
>
> links.linkurl,
> links.linktext,
> links.bannerid,
> linkdaystats.linkid
> FROM
> links,
> linkdetail ,
> linkdaystats
> WHERE
> links.linkid = linkdetail.linkid

I guess you have forgot to include: "links.linkid = linkdaystats.linkid"

Moreover, if table linkdaystats is empty that query will return NOTHING. The
solution is to remove linkdaystats from the query, or wait for 7.1 and use
OUTER JOINs.

Yours sincerely,

Edmar Wiggers
BRASMAP Information Systems
+55 48 9960 2752

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-11-07 01:49:36 Re: UNION in views
Previous Message Warren Vanichuk 2000-11-07 00:49:55 SQL question regarding a couple of table joins.