17,086
社区成员
发帖
与我相关
我的任务
分享
select r.stf_type_no, i.*
from sly_staffincome i, stf_type_relation r
where i.stf_code = r.stf_code
and to_char(r.stf_type_no) in
(select stf_type from sly_customreport where report_id = 1);
select r.stf_type_no, i.*
from sly_staffincome i, stf_type_relation r
where i.stf_code = r.stf_code
and to_char(r.stf_type_no) in
(3,4);
--試下這個是不是你要的
select r.stf_type_no, i.*
from sly_staffincome i, stf_type_relation r
where i.stf_code = r.stf_code
and exists(select 1 from sly_customreport where report_id=1 and
instr(','||sly_customreport.stf_type||',',','||r.stf_type_no||',')>0);
and to_char(r.stf_type_no) in
('3,4');
select stf_type from sly_customreport where report_id = 1
--運行出來為3,4
說明 stf_type值為'3,4'字符串
而下面的是:3和4兩個數字的集合, 不是一個概念
select r.stf_type_no, i.*
from sly_staffincome i, stf_type_relation r
where i.stf_code = r.stf_code
and to_char(r.stf_type_no) in
(3,4);