2021
01-29
01-29
PGSQL 实现查询今天,昨天的数据,一个月之内的数据
PGSQL查询今天的数据select*from表名asnwheren.create_date>=current_date;PG查询昨天的数据方法1:select*from表名asnwhereage(current_date,to_timestamp(substring(to_char(n.create_date,'yyyy-MM-ddhh24:MI:ss')FROM1FOR10),'yyyy-MM-dd'))='1days';方法2:select*from表名asnwheren.create_date>=current_date-1andn.create_date<current_date;n.create_date是一个timestamp...
继续阅读 >
其实就是最常见的到期问题。例如帐号到期,会员到期等。字段可以命名为:expire_date或valid_date场景所在的家电公司要做个不再提醒功能。其实就是有效期问题,开工。过程数据库设计字段:iduser_account用户帐号create_date创建时间update_date更新时间expire_date过期时间时间类型用设置么?例如一个月,一年。其实不用,这个参数前端传即可,在逻辑里面转换为expire_date即可。设置过期时间推荐使用java8date,非常...