查询同类型文章,时间为当篇文章以前出现的10篇文章(不包含当篇文章)

alter proc QsqArticleByClassId

@artId int=null,
@artClassId varchar(500),
@rowsCount int=null
as
if @rowsCount>0
set ROWCOUNT @rowsCount
begin
declare @date datetime
select @date = ArtPassDate from  QsqArticle where artId = @artId 
    
select  * from  QsqArticle where artClassId=@artClassId and artId<>@artId 
   
and ArtPassDate<=@date order by ArtPassDate desc
end

这里的artClassId是冗余的,也可通过定义变量得到

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2021-05-08
相关资源
相似解决方案