2021
01-27
01-27
基于postgreSql 常用查询小结
1.日期格式转化(参考)selectbeg_time,end_time,extract(epochfromto_timestamp(end_time,'yyyy-mm-dd-HH24-MI-SS-US'))-extract(epochfromto_timestamp(beg_time,'yyyy-mm-dd-HH24-MI-SS-US'))fromcdb_all_iu_datawherebeg_time>'2017-09-21'注:beg_time,end_time以TEXT形式存储,求时间差时转化为时间戳再相减得到结果(s)2.select*from(中间结果)tselectcount(*)from(selectchkid,count(*)froma...
继续阅读 >