数据库中查询时间精确到秒 方法是什么?
------解决方案--------------------
1> select
2> DATEPART ( year , getdate() ) as year,
3> DATEPART ( month , getdate() ) as month,
4> DATEPART ( day , getdate() ) as day,
5> DATEPART ( hour , getdate() ) as hour,
6> DATEPART ( minute , getdate() ) as minute,
7> DATEPART ( second , getdate() ) as second,
8> DATEPART ( millisecond , getdate() ) as millisecond
9>
10> go
year
------解决方案--------------------
month
------解决方案--------------------
day
------解决方案--------------------
hour
------解决方案--------------------
minute
------解决方案--------------------
second
------解决方案--------------------
millisecond
-----------
------解决方案--------------------
-----------
------解决方案--------------------
-----------
------解决方案--------------------
-----------
------解决方案--------------------
-----------
------解决方案--------------------
-----------
------解决方案--------------------
-----------
2010
------解决方案--------------------
9
------解决方案--------------------
24
------解决方案--------------------
17
------解决方案--------------------
30
------解决方案--------------------
56
------解决方案--------------------
647
(1 rows affected)
1>
------解决方案--------------------
1> select
2> DATEPART ( year , getdate() ) as year,
3> DATEPART ( month , getdate() ) as month,
4> DATEPART ( day , getdate() ) as day,