摘要: select sum(c) into cc from ( (select 1 as c from qhdata_warehouse_north_stat.dw_ytb_org_base where occur_period = max_period limit 1 ) union all (sele 阅读全文
posted @ 2020-12-22 11:10 star521 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 取上个数据期,并将数值插入到变量中 /* 上个季度的数据期 */ DECLARE max_period int4; select DATE_FORMAT(date_sub(concat(year(now()),'-',lpad((quarter(now())-1)*3+1,2,'0'),'-01') 阅读全文
posted @ 2020-12-22 10:47 star521 阅读(225) 评论(0) 推荐(0) 编辑