【问题标题】:grouping the sql statements in oracle stored procedureoracle存储过程中的sql语句分组
【发布时间】:2014-03-04 15:55:57
【问题描述】:

在 oracle 存储过程中对 sql 语句进行分组时出现错误。请查看我的代码 select count(decode(msg_trans_type,'EXCH','Y',NULL)) EXCH INTO total_exchange_requests, count(decode( msg_trans_type,'BUY','Y',NULL)) 购买total_buy_requests, count(decode(msg_trans_type,'SELL','Y',NULL)) 出售来自tra_message 的total_sell_requests 其中msg_service_provider = in_svc_provider AND trunc(msg_when_created) = to_date (in_start_date,'dd-mon-yyyy');我收到错误(15,17):PL/SQL:ORA-00934:此处不允许使用组函数,请查看并提出您的意见。

【问题讨论】:

    标签: oracle11g


    【解决方案1】:

    您使用了错误的语法。

    试试:

    select count(decode(msg_trans_type,'EXCH','Y',NULL)) EXCH,
           count(decode(msg_trans_type,'BUY','Y',NULL)) BUY,
           count(decode(msg_trans_type,'SELL','Y',NULL)) SELL
    INTO total_exchange_requests, total_buy_requests, total_sell_requests
    ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-10
      • 2011-04-29
      • 1970-01-01
      相关资源
      最近更新 更多