楼主这问题很特别,未发现问题出在哪,按理不应该出现。楼主sql有一点不好的地方,笛卡尔积。 (select tc.unit_name, ta.ash, tc.unit_name || ta.ash un from t_client_info tc, t_ash_info ta where ta.ash in ('II级灰', 'III级灰', '粗灰')) c
把报错信息帖出来啊把每个 or 条件用括号包起来试试 where (ws.zrl is not null )or ws.jrjh is not null or ws.zrjh is not null or ws.unit_name in (select w1.unit_th from t_weight_info w1 where w1.weigh_date = '2014-07-03' and w1.s_type in('II级灰','III级灰','粗灰')) or ws.unit_name in (select s1.unit_name from t_sale_plan s1 where s1.p_stime between '2014-07-02' and '2014-07-03' and s1.s_type in('II级灰','III级灰','粗灰'))
(select tc.unit_name, ta.ash, tc.unit_name || ta.ash un
from t_client_info tc, t_ash_info ta
where ta.ash in ('II级灰', 'III级灰', '粗灰')) c
2. SQL 窗口,你转轮子了吗?(如果你使用的是 PL\SQL Developer 的话)。
where (ws.zrl is not null )or ws.jrjh is not null or ws.zrjh is not null
or ws.unit_name in (select w1.unit_th from t_weight_info w1 where w1.weigh_date = '2014-07-03' and w1.s_type in('II级灰','III级灰','粗灰'))
or ws.unit_name in (select s1.unit_name from t_sale_plan s1 where s1.p_stime between '2014-07-02' and '2014-07-03' and s1.s_type in('II级灰','III级灰','粗灰'))