摘要: SELECT substring(OfficeCapBuildNum,charindex('|',OfficeCapBuildNum)+1 , len(OfficeCapBuildNum) ) FROM [Apk_OfficeCapture] WHERE OfficeCapProductName=' 阅读全文
posted @ 2016-07-12 22:42 change_4_now 阅读(128) 评论(0) 推荐(0) 编辑
摘要: select staffId, (SELECT MachineIP+ ',' FROM STAFF_ATTENDANCE r WHERE r.staffId= 55 FOR XML PATH('') ) gg from STAFF_ATTENDANCE a group by a.staffId 阅读全文
posted @ 2016-07-12 22:42 change_4_now 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 分组:SELECT * FROM(SELECT ROW_NUMBER() OVER(ORDER BY ProjID) as row_number,* FROM (select ProjApplyDate,projProperty,ProjID,ProjStatusCurrent,ProjGuId,P 阅读全文
posted @ 2016-07-12 22:41 change_4_now 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 表值函数:ALTER FUNCTION getTable( )RETURNS TABLE ASRETURN ( select * from tb)取值:select * from getTable( )标量函数:ALTER FUNCTION [dbo].[CamOnlineAverage] ( @p 阅读全文
posted @ 2016-07-12 22:41 change_4_now 阅读(163) 评论(0) 推荐(0) 编辑
摘要: SELECT cast(cast( SUM(SumTime)*100 as float)/SUM(TotalTime) as decimal(10,2)) FROM (SELECT ROW_NUMBER() OVER(ORDER BY CamId) AS RowNum,CamId,CamName,C 阅读全文
posted @ 2016-07-12 22:41 change_4_now 阅读(192) 评论(0) 推荐(0) 编辑
摘要: cast(cast( SUM(SumTime)*100 as float)/SUM(TotalTime) as decimal(10,2)) 阅读全文
posted @ 2016-07-12 22:40 change_4_now 阅读(97) 评论(0) 推荐(0) 编辑
摘要: select @@IDENTITY ; 阅读全文
posted @ 2016-07-12 22:39 change_4_now 阅读(155) 评论(0) 推荐(0) 编辑
摘要: select isnull(CamSeqId, '') as CamSeqId,isnull(cam_config.value('(xml/cam/StardardValue)[1]','int'),0) as StardardValue, isnull(cam_config.value('(xml 阅读全文
posted @ 2016-07-12 22:38 change_4_now 阅读(88) 评论(0) 推荐(0) 编辑
摘要: SELECT * INTO #Dat_ProjectServer20160613 FROM Dat_ProjectServer--临时表 SELECT * INTO t2 FROM t1--新建一张表 阅读全文
posted @ 2016-07-12 22:38 change_4_now 阅读(98) 评论(0) 推荐(0) 编辑
摘要: UPDATE dbo.Dat_Camera SET Cam_Config='<xml><cam><type>2</type>'+CASE WHEN Cam_DX_VideoId is NOT NULL THEN '<naming>'+CAST(Cam_DX_VideoId AS NVARCHAR(1 阅读全文
posted @ 2016-07-12 22:37 change_4_now 阅读(175) 评论(0) 推荐(0) 编辑