CREATE PROCEDURE Selectbycontent
@content varchar(100)
AS
BEGIN
select c.id,[name],title,createtime,caid from news n join category c on n.caid=c.id
where n.content like '%'+@content+'%'
order by createtime desc
END
GO
根据内容取出新闻的内容
最新推荐文章于 2022-02-25 20:00:37 发布
博客给出了一段SQL存储过程代码,该存储过程名为Selectbycontent,接收一个varchar类型的参数@content,用于在news和category表中查询新闻信息,通过模糊匹配新闻内容,按创建时间降序排列结果。
3万+

被折叠的 条评论
为什么被折叠?



