sqlserver 字符串日期比较大小

Posted hoge66

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sqlserver 字符串日期比较大小相关的知识,希望对你有一定的参考价值。

select top 20 *from sp_goodscontent
 where LEN(goodsId)>3 and buyNow is not null 
and giftArray=‘好单库‘
--and goodsId=‘560969552229‘
order by CREATE_date DESC

select count(1) from sp_goodscontent
 where  buyNow is null 
and giftArray=‘好单库‘

select count(1) from sp_goodscontent
 where   giftArray=‘好单库‘
and buyNow is not null

select  *from sp_goodscontent
 where LEN(goodsId)>3 and buyNow is null 
--and giftArray=‘好单库‘
and len(goodsClick)<9
order by CREATE_date DESC

DELETE from sp_goodscontent
 where LEN(goodsId)>3 and buyNow is null 
--and giftArray=‘好单库‘
and len(goodsClick)<9

--update sp_goodscontent set isbook=0 where isbook=1
SELECT * FROM sp_goodscontent where isbook=1

SELECT CONVERT(date ,coupon_end_time,23) from sp_goodscontent  where coupon_end_time LIKE ‘20%‘


SELECT * from sp_goodscontent where coupon_end_time <>‘‘


SELECT coupon_end_time from sp_goodscontent where coupon_end_time LIKE ‘20%‘
AND DATEDIFF(SECOND,‘2019-07-15‘,CONVERT(date ,coupon_end_time,23))>1

  

以上是关于sqlserver 字符串日期比较大小的主要内容,如果未能解决你的问题,请参考以下文章

sql日期比较大小

sqlserver如何比较两个日期(datetime)的年月大小,比较到年月,不比较日

SQL 比较时间大小

sql server中字符串类型的日期如何比较大小

js关于日期比较大小

CDateTimeCtrl类型的日期如何比较大小