在sql server / Oracle中获取日期 [英] get date in sql server / Oracle
本文介绍了在sql server / Oracle中获取日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望得到一个sql查询,以便基于coloumn validto 和 validfrom
,使得validto coloumn为地址表应该大于当前日期,并且结果中应该有null adreess
ID名称ValidTo ValidFrom
1 aa null null
2 bb 31-dec-2010 null
3 cc null null
包含空查询而不是当前日期的过去日期
I want to get a sql query such that based on the coloumn validto and validfrom
in such a way that the validto coloumn for the address table should be greater than current date and it should have null adreess in the result
ID Name ValidTo ValidFrom
1 aa null null
2 bb 31-dec-2010 null
3 cc null null
Contains the null query and not the past date from the current date
推荐答案
For Sql Server
select * from table_Name where validto>getdate()
for Pl/Sql
select * from table_Name where validto>sysdate()
这篇关于在sql server / Oracle中获取日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文