select * from a
where a1 between (select b1 from b where to_char(a_date, 'yyyymm') like '%200901%')
and (select b2 from b where to_char(a_date, 'yyyymm') like '%200901%' )这样写可以吗?谢谢!
...全文
939打赏收藏
between and
select * from a where a1 between (select b1 from b where to_char(a_date, 'yyyymm') like '%200901%') and (select b2 from b where to_char(a_date, 'yyyymm') like '%200901%' )这样写可以吗?谢谢!
select * from a
where a1 between
(select min(b1) from b where to_char(a_date, 'yyyymm') like '%200901%')
and
(select max(b2) from b where to_char(a_date, 'yyyymm') like '%200901%' )