On Jul 18, 2007, at 16:12 , Pat Maddox wrote:
> ERROR: invalid reference to FROM-clause entry for table "video_views"
> LINE 20: JOIN assets ON (video_views.video_id=videos.id)
> ^
> HINT: There is an entry for table "video_views", but it cannot be
> referenced from this part of the query.
It's because I mismatched the JOIN clauses during my copy-and-paste :(
> On 7/18/07, Michael Glaesemann <grzm@seespotcode.net> wrote:
>> FROM video_views
>> JOIN assets ON (video_views.video_id=videos.id)
>> JOIN videos ON (video_views.asset_id=assets.id)
This should be
FROM video_views
JOIN assets ON (video_views.asset_id=assets.id)
JOIN videos ON (video_views.video_id=videos.id)
Do you have the EXPLAIN ANALYE output of the query?
Michael Glaesemann
grzm seespotcode net