ステータスコードが異なる単一のテーブルからレコードをカウントしたいSQLを書きたいです。このようなクエリを書きました
select
(
(
select count(*) as "Entry"
from cn_grc_hdr hdr
where hdr.unit_code = '03' and
hdr.crt_dt > '12-may-2013' and
hdr.status = 'E'
),
(
select count(*) as "Authorised"
from cn_grc_hdr hdr
where hdr.unit_code = '03' and
hdr.crt_dt > '12-may-2013' and
hdr.status = 'A'
)
)
from dual
このクエリを実行すると、エラーが表示されます (Oracle sql 開発者で)
ORA-00907: 右括弧00907がありません。00000 - 「右括弧がありません」原因: アクション: 行: 5列: 5でエラーが発生しました
私のフォーマットが間違っているかもしれません。誰かがこのようなクエリを書くのを手伝ってくれますか?