根据类别id取出该类别下相应的新闻

USE [Publishing System ]
GO
/****** Object:  StoredProcedure [dbo].[procselectnewsbycaid]    Script Date: 05/12/2010 12:19:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  韩慧
-- Create date: 2010-4-15
-- Description:根据类别id取出该类别下相应的新闻
-- =============================================
ALTER PROCEDURE [dbo].[procselectnewsbycaid]
 @caid int
AS
BEGIN
 SELECT n.id,n.title,n.createtime ,n.caid ,c.name from news n
 inner join category c on n.caid=c.id and n.caid=@caid
 order by n.createtime desc
END

你可能感兴趣的:(C++,c,C#,Go)