随笔分类 -  Sql Service

摘要:一。select * from(select ID,ShopClient_ID,Name,Icon,HitCount,Class1_ID,row_number() over(partition by Class1_ID order by HitCount desc)as rowindex from ... 阅读全文
posted @ 2014-06-26 13:51 一个人的风 阅读(1028) 评论(0) 推荐(0)
摘要:http://wenku.baidu.com/link?url=7ZBtIEQr6iAdQrpx2O7Z6s-gPwatltWsPwWY74qyBiJYiyZI5aGQ7wJNsnt5IRicb2d8C0upAnoqtXTOBMyrqnRwlscx9-o5sYmz6namGJW 阅读全文
posted @ 2014-06-23 15:21 一个人的风 阅读(160) 评论(0) 推荐(0)
摘要:--=================行专列=======================--if object_id('tb')is not null drop table tb--go--create table tb(姓名 varchar(10),课程 varchar(10),分数 int)-... 阅读全文
posted @ 2014-05-18 16:57 一个人的风 阅读(156) 评论(0) 推荐(0)
摘要:GetWorkPosNameselect b.ID,((select OrganizationName from :EOPDBName..vw_All_Organization c where c.ID=b.OrgID)+'_'+(case when b.GrpName is null then '' else b.GrpName+'_' end) +(case when b.BudName is null then '' else b.BudName+'_' end)+(case when b.UnitNo is 阅读全文
posted @ 2013-08-16 21:04 一个人的风 阅读(167) 评论(0) 推荐(0)
摘要:if exists(select 1 from sysobjects where id=object_id('St_FunPostDayTimeout'))drop Function St_FunPostDayTimeoutgoCreate Function St_FunPostDayTimeout()returns varchar(2000)asbegindeclare MyCursor cursorfor (select distinct count(budid) countBudid ,budid,budname from vw_WorkOrdWarning a inne 阅读全文
posted @ 2013-08-16 21:03 一个人的风 阅读(195) 评论(0) 推荐(0)
摘要:1. MySQL支持enum,和set类型,SQL Server不支持2. MySQL不支持nchar,nvarchar,ntext类型3. MySQL的递增语句是AUTO_INCREMENT,而MS SQL是identity(1,1)4. MS SQL默认到处表创建语句的默认值表示是((0)),而在MySQL里面是不允许带两括号的5. MySQL需要为表指定存储类型6. MS SQL识别符是[],[type]表示他区别于关键字,但是MySQL却是 `,也就是按键1左边的那个符号7. MS SQL支持getdate()方法获取当前时间日期,但是MySQL里面可以分日期类型和时间类型,获取当前日 阅读全文
posted @ 2013-08-16 21:02 一个人的风 阅读(9310) 评论(0) 推荐(0)