SELECT SUM(tjo.pay_amount) FROM tb_jf_order tjo,tb_jf_gateway_trade_log tjg
WHERE tjo.order_id = tjg.biz_id AND
tjo.user_id = tjg.user_id AND
(tjg.trade_type='p' OR tjg.trade_type='t') AND
tjo.user_id=''AND
tjo.order_state='' AND
tjo.order_type NOT IN ('','','') AND
tjo.order_date = to_char(SYSDATE,'yyyyMMdd');

1、上述sql中如果的两个or语句一定要赢括号括起来。

05-04 11:26