請教大家
語法1會抓出包含哪些文章有被USER點選likes的pageid
select a.*,b.title, b.contenttype from likes a,content b where a.contentid=b.contentid and a.creationdate between '2016/8/1' and '2016/9/1' order by a.creationdate desc
語法2則會抓出屬於同一個樹狀文章的所有pageid
select c1.PAGEID,c1.TITLE,c2.TITLE,c3.TITLE,c4.TITLE
from CONTENT c1
left outer join CONTENT c2
on c2.PARENTID = c1.CONTENTID
left outer join CONTENT c3
on c3.PARENTID = c2.CONTENTID
left outer join CONTENT c4
on c4.PARENTID = c3.CONTENTID
where c1.PARENTID='43941959'
是否有辦法讓語法1抓出來的pageid讓其自動計算每顆樹狀文章like的總和呢?謝謝