次のようなオラクルの構文があります:
select 'Tanggal : '||to_char(c,'DD-MON-YYYY hh:mm:ss')||',' as Tgl,
case
when (select ((a.sk/b.tot)*100)
from (select count(to_char(response))sk
from log where response like '%OK%')a,
(select count(*)tot from log)b)<100
then (select 'Error : '||to_char(response),count(to_char(response)) je
from log
group by to_char(response)
order by je desc)
else
(select 'Success Rate : '||substr((a.sukses/b.total)*100,1,5)||' %,'as Success_rate
from (select count(to_char(response)) sukses from log where response like '%OK%')a, (select count(*) total from log)b)
end as test
from log
where rownum <= 1;
ORA-00907: missing right parenthesis,
しかし、「order by je desc」というエラーメッセージが送信されます。
では、エラーが発生しないようにするにはどうすればよいですか?