111,120
社区成员
发帖
与我相关
我的任务
分享
alter PROCEDURE procNewsSelectNewsByCaid
(
@caid int
)
AS
BEGIN
select n.id,n.title,n.createTime,c.[name] from news n
inner join category c on c.id = n.caId and n.caId =@caid
order by n.createTime desc
END
GO
CREATE PROCEDURE procNewsSelectNewsByCaid
AS
declare @caid int
BEGIN
select n.id,n.title,n.createTime,c.[name] from news n
inner join category c on c.id = n.caId and n.caId =@caid
order by n.createTime desc
END
GO
select n.id,n.title,n.createTime,c.[name] from news n
inner join category c on c.id = n.caId and n.caId = 2
order by n.createTime desc
CREATE PROCEDURE procNewsSelectNewsByCaid
@caid int
AS
BEGIN
select n.id,n.title,n.createTime,c.[name] from news n
inner join category c on c.id = n.caId and n.caId = @caid
order by n.createTime desc
END
GO 你的是SqlServer吗