postgresql随笔
1.日期加减天数计算 cast(cast(b.f_date as text) as date )+ 365
2.本机安装postresql默认用户名密码 用户名:postgres 密码:postgres 数据库:postgres
3.两个日期计算 select date'20170302' - date'20170228' 4. select to_char(current_date,'yyyymmdd');--date 转 text
5.10 * * * * cd /home/xx/xx/xx && python zzz.py > log.txt 2>&1
6.mysql中当前日期 select date_format(now(),'%Y%m%d') ;其中%Y表示4位年数,%y表示两位年数 前一天为DATE_SUB(date_format(now(),'%Y%m%d'),INTERVAL 1 day) postgredql中 cast(to_char(current_date - 1,'yyyymmdd') as int) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |