码迷,mamicode.com
首页 > 数据库 > 详细

Sql Server 常用语句

时间:2018-12-14 13:07:45      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:rds   com   sql   varchar   select   var   buffer   sql 语句   get   

AND DateDiff(dd, convert(varchar(50), ‘2018-11-28‘) , DataDate) >= 0
AND DateDiff(dd, convert(varchar(50), ‘2018-11-28‘) , DataDate) <= 0

SELECT Ceiling(rand() * 1000)

select Convert(decimal(18, 3), ‘5.26415‘)
select Convert(Varchar,GetDate(),120)
select Convert(Varchar,GetDate(),23)

dbcc dropcleanbuffers
dbcc freeproccache
set statistics io on
go
--Sql 语句
set statistics io off
go

--自连接
select * from OutcomeRecords as a
where a.DateOutcome in
( select Max(DateOutcome) from OutcomeRecords as b where a.PatientID = b.PatientID and b.DelMark = ‘0‘ );

Sql Server 常用语句

标签:rds   com   sql   varchar   select   var   buffer   sql 语句   get   

原文地址:https://www.cnblogs.com/kikyoqiang/p/10118228.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!