Sql Server 常用语句
Posted Kikyo
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sql Server 常用语句相关的知识,希望对你有一定的参考价值。
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 常用语句的主要内容,如果未能解决你的问题,请参考以下文章