Using this Query:
explain SELECT w.counter_id, ( date_part('month', w.stat_date) || '/' || date_part('day', w.stat_date)
|| '/' || date_part('year', w.stat_date) || ' 00:00:00')::datetime as
dayperiod, r.referrer_id, count(w.referrer_hits) FROM webhit_referer_raw w, referrer_data r, referrer_link l
WHEREw.stat_date < 'Jan 25 2000' AND w.referrer_url = r.referrer AND l.counter_id = w.counter_id AND
l.stat_date= dayperiod AND l.referrer_id = r.referrer_id
GROUP BY dayperiod, counter_id, referrer_id
ORDER BY counter_id, dayperiod;
I get:
ERROR: attribute 'dayperiod' not found
I'm guessing right now its on: "AND l.stat_date = dayperiod"
Should that not work? And, I know, its a major mess, just a thought I'm
playing with ... :)
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org