缺少右括号 [英] Missing right parenthesis

查看:112
本文介绍了缺少右括号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下oracle查询.当我尝试执行此查询时,它将引发错误ORA-00907缺少右括号.我敢肯定所有打开的括号都已关闭.我认为问题在于COALESCE函数,否则查询工作正常.有什么解决方法吗?

I have the following oracle query. When I try to execute this query it throws the error- ORA-00907 missing right parenthesis. I am sure about all the open braces are closed. I think the problem with is COALESCE function otherwise the query works fine. Any work arounds?

Select * From A

AND (('1-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce (OM_MERCH_CUST.MC_TO_DT,sysdate()))

OR('30-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce (OM_MERCH_CUST.MC_TO_DT,sysdate())));

推荐答案

重新格式化语句,使花括号对齐:
Re-formatting your statement so braces are aligned:
Select * From A
AND 
  (
    (
      '1-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce 
      (
        OM_MERCH_CUST.MC_TO_DT,sysdate
        (
        )
      )
    )
  OR
    (
      '30-Nov-2010' between OM_MERCH_CUST.MC_FM_DT AND coalesce 
      (
        OM_MERCH_CUST.MC_TO_DT,sysdate
        (
        )
      )
    )
  );

您拥有正确数量的花括号,但您是不是要在AND中包含OR子句?

You have the right number of braces, but did you mean to have the OR clause within the AND?


这篇关于缺少右括号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆