sql语句问题,大虾帮忙
我怎么能达到下面的效果呢?
select a.branch_no
from st_comein_bill a,st_comein_bill_detail b,sys_config c
where a.comein_bill_seq = b.comein_bill_seq
and to_char(to_number(a.year||a.month)-1) = select conf_value from sys_config where conf_key = 'st_amounth_acc_month'
这个格式肯定是错的
但我要与to_char(to_number(a.year||a.month)-1)比较的值需要从另外一个表里查出来
我怎么样写才能达到这样的目的?
谢谢