取与当前月同年的所有月份数据

select

calmonth as '月份',by_income as '本月收入',tq_income as '同期收入',tb_income_rate as '收入同比',hb_income_rate as '收入环比'

from 

app_db.yw_m

where calmonth =translate(substr(current_date() , 1 ,7),'-','')

现在是只取本月的数,我想改成取本年所有月的数据,应该怎么改呢?

FineReport 用户x076327 发布于 2021-11-24 11:19
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
1
yzm119464Lv3初级互助
发布于2021-11-24 11:27

select

calmonth as '月份',by_income as '本月收入',tq_income as '同期收入',tb_income_rate as '收入同比',hb_income_rate as '收入环比'

from 

app_db.yw_m

where calmonth between substr(current_date() , 1 ,4)||'01' and  translate(substr(current_date() , 1 ,7),'-','')

  • 2关注人数
  • 184浏览人数
  • 最后回答于:2021-11-24 11:27
    请选择关闭问题的原因
    确定 取消
    返回顶部