create_time betweensql
to_timestamp(now()-interval '1 hour', 'yyyy-mm-dd hh24:00:00')oracle
andspa
to_timestamp(now(), 'yyyy-mm-dd hh24:00:00')date
select DATE_FORMAT(create_time,'%Y-%m-%d') as day1,count(1) from g_driver_counter_log where create_time>'2016-10-17 00:00:00' group by day1;
select time_key/10000 as day1,count(1) from isc_driver_counter_log where create_time>'2016-10-17 00:00:00' group by day1;select
to_timestamp(now(),'yyyy-mm-dd HH24:MI:SS')im
psql 的to_date (oracle的to_date返回是下面的圖2)查詢
select to_date(create_time, 'yyyy-mm-dd HH24:MT:SS') from isc_driver_counter_log_dict where business_type in(26,27);dict
返回結果:img
select to_timestamp(create_time, 'yyyy-mm-dd HH24:MT:SS') from isc_driver_counter_log_dict where business_type in(26,27);di