日期:2014-05-18 浏览次数:20501 次
set @sql=N'SELECT a.ID,Title,AddDate ' +@tablename+ ' a INNER JOIN @Products b ON CHARINDEX(b.keyWord,a.Title)>0 WHERE CONTAINS(Title,@contains) GROUP BY a.ID,Title,AddDate ORDER BY Sum(keyNum) DESC,COUNT(DISTINCT keyword),AddDate desc' print @sql exec sp_executesql @sql
SELECT a.ID,Title,AddDate FS_News a INNER JOIN @Products b ON CHARINDEX(b.keyWord,a.Title)>0 WHERE CONTAINS(Title,@contains) GROUP BY a.ID,Title,AddDate ORDER BY Sum(keyNum) DESC,COUNT(DISTINCT keyword),AddDate desc 消息 102,级别 15,状态 1,第 1 行 'a' 附近有语法错误。