From: | Warren Vanichuk <pyber(at)street-light(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | SQL question regarding a couple of table joins. |
Date: | 2000-11-07 00:49:55 |
Message-ID: | Pine.LNX.4.21.0011061638120.18907-100000@urd.street-light.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 default nextval('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
From | Date | Subject | |
---|---|---|---|
Next Message | Edmar Wiggers | 2000-11-07 01:14:58 | RE: SQL question regarding a couple of table joins. |
Previous Message | Roberto Mello | 2000-11-07 00:41:28 | UNION in views |