摘要: -- =============================================-- Author:<Author,,Name>-- Create date: <Create Date,,>-- Description:修改新闻-- =============================================ALTER PROCEDURE [dbo].[news_UpdateByID] @newsName varchar(100), @classID int, @newsContent text, @newsID intASBEGINupd 阅读全文
posted @ 2012-06-03 23:31 hishanghai 阅读(121) 评论(0) 推荐(0)
摘要: selectage,count(*),max(age)as最大年龄fromperson1groupbyAgehavingAge>20selecttop3*fromperson1--筛选出年龄不在top3中的数据,也就是第四、五selecttop2*fromperson1whereagenotin(selecttop3agefromperson1orderbyagedesc)orderbyage--去掉数据重复selectDepartment,count(*)fromperson1groupbyDepartmentselectdistinctDepartment,Agefromperson 阅读全文
posted @ 2012-06-03 23:13 hishanghai 阅读(338) 评论(0) 推荐(0)
摘要: ALTER TRIGGER [dbo].[trigCateDelete] ON [dbo].[category] instead of DELETEAS BEGIN declare @caId int select @caId=(select id from deleted) delete comment where newsId in (select newsId from news where caId=@caId) delete news where caId=@caId delete category where id=@caIdENDALTER procedure [dbo].[p. 阅读全文
posted @ 2012-06-03 23:12 hishanghai 阅读(87) 评论(0) 推荐(0)