根据新闻id查询新闻内容

USE [Publishing System ]
GO
/****** Object:  StoredProcedure [dbo].[procselectnewsbyid]    Script Date: 05/12/2010 12:45:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  韩慧
-- Create date: 2010-4-15
-- Description: 根据新闻id查询新闻内容
-- =============================================
ALTER PROCEDURE [dbo].[procselectnewsbyid]
 @id int
 as
 BEGIN
 
 SELECT n.id,n.title,n.[content],n.createtime,n.caid,c.userip ,c.createtime as ctime from news n
 left join comment c on
   n.id=c.newsid where n.id=@id
 
 
END

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