psql
文章平均质量分 56
琼小宝的崔二宝
好好学门技术。。。可惜自己有点笨。。。
展开
-
psql获取当前时间和自增长id
1.now() 返回结果:2017-04-13 18:26:36.0234 2. create_time 返回结果:2017-04-13 18:26:36.0234前提是在创建表的时候把date字段设置为:timestamp without time zone格式 eg: CREATE TABLE ods.mars_create_subplan ( id serial原创 2017-04-14 14:29:38 · 889 阅读 · 0 评论 -
psql计算环比和同比
\c dw; –连接到数据库drop table if exists stg.d_mars_rate_hb_1 ;create table if not exists stg.d_mars_rate_hb_1( category_1 TEXT, date DATE, quantity numeric(30,16) );insert into stg.d_mars_rate_hb_原创 2017-04-17 14:23:05 · 4204 阅读 · 0 评论