2015-04-17 32 views
2

我使用Vertica的DB地方使用時間戳列,要查詢的財產以後,如:如何Vertica的

select count(*) from users where create_ts ='2015-04-17 05:01:02' 

其中create_ts是時間戳。我得到零計數,但我有很多記錄。

回答

1

時間戳精確到比第二個更精確。嘗試使用間隔:

select count(*) 
from users 
where create_ts >= '2015-04-17 05:01:02' and 
     create_ts < '2015-04-17 05:01:03'; 
0

從日期部分可以用秒,

select count(*) from users where date(create_ts) ='2015-04-17 05:01:02' 

沒有你必須要具體到最詳細級別的日期功能。