旅游网站源代码模板谈谈自己对市场营销的理解
web/
2025/10/9 11:53:29/
文章来源:
旅游网站源代码模板,谈谈自己对市场营销的理解,福州企业网站,档案网站建设经验背景
想获取if_yc为1连续账期数据
思路
获取所有if_yc为1的账期数据下一行减去上一行账期#xff0c;如果为1则为连续#xff0c;不等于1就为断档获取不等于1的最小账期#xff0c;就是离当前账期最近连续账期
代码
以下为mysql语法#xff1a;
select acct_month
f…背景
想获取if_yc为1连续账期数据
思路
获取所有if_yc为1的账期数据下一行减去上一行账期如果为1则为连续不等于1就为断档获取不等于1的最小账期就是离当前账期最近连续账期
代码
以下为mysql语法
select acct_month
from(
select (m:m1) rn,acct_month
from(
select 202311 acct_month,1 if_yc
union all
select 202310,1
union all
select 202309,1
union all
select 202308,0
union all
select 202307,1
union all
select 202306,1) a,(select m:0) b
where if_yc 1
order by acct_month desc
) m ,
(select min(t1.rn)1 rn1-- ,t1.acct_month-t2.acct_month
from (
select (i:i1) rn,acct_month
from(
select 202311 acct_month,1 if_yc
union all
select 202310,1
union all
select 202309,1
union all
select 202308,0
union all
select 202307,1
union all
select 202306,1) a,(select i:0) b
where if_yc 1
order by acct_month desc ) t1 ,
(
select (j:j1) rn,acct_month
from(
select 202311 acct_month,1 if_yc
union all
select 202310,1
union all
select 202309,1
union all
select 202308,0
union all
select 202307,1
union all
select 202306,1) a,(select j:-1) b
where if_yc 1
order by acct_month desc
) t2 where t1.rn t2.rn and t1.acct_month-t2.acct_month 1 ) n
where rn n.rn1
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/89616.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!