以下是你需要的SQL:
select conceptName,COUNT(distinct blogId) as Tot
from conceptTable ct
join blogs on content like '%'+ct.conceptName+'%'
group by conceptName
爲了得到一個概念出現
select conceptName,min(inputDate) as FirstTime,COUNT(distinct blogId) as Tot
from conceptTable ct
join blogs on content like '%'+ct.conceptName+'%'
group by conceptName
爲了得到最近的日期的一個概念出現
select conceptName,max(inputDate) as MostRecent,COUNT(distinct blogId) as Tot
from conceptTable ct
join blogs on content like '%'+ct.conceptName+'%'
group by conceptName
爲了第一次約會獲得所有日期
select conceptName,inputDate,COUNT(distinct blogId) as Tot
from conceptTable ct
join blogs on content like '%'+ct.conceptName+'%'
group by conceptName,inputDate
博客表中的哪個字段包含這個概念? – Sparky
該概念在概念名下的單獨表中保存,博客表只包含條目。所以這兩個表格需要相互比較?或加入? – stefan
好的,您的博客表中有一個名爲CONTENT的文本字段?在這個領域內,可以輸入悲傷,憤怒等情緒?是對的嗎? – Sparky