SQL question regarding a couple of table joins. - Mailing list pgsql-sql

From Warren Vanichuk
Subject SQL question regarding a couple of table joins.
Date
Msg-id Pine.LNX.4.21.0011061638120.18907-100000@urd.street-light.com
Whole thread Raw
Responses RE: SQL question regarding a couple of table joins.
List pgsql-sql
Greetings.

We three have three tables, a links table which stores basic information
about a link, a linksdetail table which stores more detailed information
about the link, and a linkdaystats table which records the daily statistical
information on the link.

My problem is, once a day I want to delete everything in that table to start
afresh.  Any information accumulated in the linkdaystats table has been
parsed, multilated, spindled, whatever, and done with, do I merely do a
'drop from linkdaystats' to start afresh.  The only issue is this causes
other queries to break, suck as the only below :

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

----linkid | linkurl | linktext | bannerid | linkid 
--------+---------+----------+----------+--------
(0 rows)
----

Help?  :)  This is PostGreSQL 7.0.2 on Debian 2.2/Linux-2.2.17 (Kernel/PGSQL
from source)

--- Table information :

freehost=# \d links                                Table "links"Attribute |     Type     |
Modifier                     
 
-----------+--------------+----------------------------------------------------linkid    | integer      | not null
defaultnextval('links_linkid_seq'::text)linkurl   | varchar(255) | linktext  | varchar(255) | bannerid  | integer
|
 
Index: links_linkid_key

freehost=# \d linkdetail            Table "linkdetail"    Attribute     |     Type     | Modifier 
-------------------+--------------+----------linkid            | integer      | referrer          | varchar(255) |
maxclicks        | integer      | maximpressions    | integer      | primarycategory   | integer      |
secondarycategory| integer      | tertiarycategory  | integer      | weight            | float4       | starttime
 | timestamp    | stoptime          | timestamp    | 
 

freehost=# \d linkdaystats       Table "linkdaystats" Attribute  |   Type    | Modifier 
-------------+-----------+----------linkid      | integer   | datestamp   | timestamp | clicks      | bigint    |
impressions| bigint    | 
 


Sincerely, Warren



pgsql-sql by date:

Previous
From: Roberto Mello
Date:
Subject: UNION in views
Next
From: "Edmar Wiggers"
Date:
Subject: RE: SQL question regarding a couple of table joins.