我有两个表关键字和帖子
关键字表看起来像
keyword weight
1 0.3
2 0.5
3 0.4
例如
和张贴表
post
i am beautiful
1, 2, 3
1 + 3 = 4
如果我想从 post 表中求和重量
也就是说
我想得到结果
post total
1, 2, 3 1.2
1 + 3 = 4 0.7
像这样
我应该使用连接子句吗?
create procedure RankingPost8
(@concept_name nvarchar(50))
AS
declare @k1 nvarchar(200)
select @k1 = keyword from keyword where concept_id =
(select Concept_ID from concept where @concept_name = Concept_name)
Select @K1 = coalesce(@k1 +' ','') + keyword from keyword
begin
select id as Post_ID, post as Txt from Post
where freetext (post, @k1)
end