SQL Server数据库优化笔记

不定时更新

select DateDiff(month,'2018-06-07',GETDATE())

select DateDiff(month,( select TOP 1  PACTBEGINDATE from LEGAL_PACTSET_INFO where CUSTOMERID =1205 ORDER BY PACTBEGINDATE ASC),GETDATE())

select MIN(PACTBEGINDATE) from LEGAL_PACTSET_INFO where CUSTOMERID =104;

SELECT  top 1 PACTBEGINDATE  FROM dbo.LEGAL_PACTSET_INFO WHERE CUSTOMERID=104   ORDER BY PACTBEGINDATE ASC

 

posted @ 2018-09-07 09:08  xh_Blog  阅读(221)  评论(0编辑  收藏  举报