Yes, I am being naughty and posting a technical question, but I don't
believe I am signed up to the cf-talk list right now.  Besides, all the
smart folks hang out here anyway ;)

I have been asked to get info out of a group of tables.  Duh, right?  Well,
the problem is, the main table that links all of the others together
has 7.5million records.  Just doing a SELECT * on it times out. 
Linking it with
the other tables doesn't work very well either.  Here is an example of the
query I am trying to get to work .. Is there a better way to write this
thing?  We are using MySQL 4.

SELECT c.Cat, v.MC, v.CatID, v.VideoID, v.MovieTitle, SUM(s.TotalTime)
FROM catagories c, videos v, users u, salesreport s
WHERE u.ADVID > 0
   AND u.UserID = s.UserID
   AND c.catid = v.catid
   AND v.videoid = s.videoid
GROUP BY v.VideoID
ORDER BY c.Cat


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:5:202308
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to