Hi All,
I’m attempting to combine two queries in order to improve performance. I have created the following SQL which works but doesn’t do the ORDER BY section correctly - it doesn’t extract the 5 most recent linknum’s
select l.linknum, l.catagory, l.name, l.link, l.views, count(r.linknum) as RATECOUNT, sum(r.rating)from links l, ratings rwhere l.linknum=r.linknum and l.catagory=64 group by l.linknum, l.catagory order by l.linknum desc limit 5;
Any idea what is wrong with this? The following is the original single query where the ORDER BY works:
select linknum, catagory, name, link, date_entered from links where catagory in (64) order by linknum desc limit 5;
Many thanks
p