I'm trying to get output from :
select count(r.id) and count(r.key) from rules r where lower(r.name) in ('xss attack','dos attack') ;
but getting error like
ORA-00923: FROM keyword not found where expected
I tried below solution :
select (select count(r.id) from rules r where lower(r.name) in ('xss attack','dos attack')) AS name,(select count(r.key) from rules r where lower(r.name) in ('xss attack','dos attack')) AS name from rules;
Please correct me if any improvement is required for above query.
Output I'm getting is like
NAME NAME
2 2
2 2
while i expect my output should like as
NAME NAME
2 2
andin your select list is causing your original problem. Look at Renato's answer below for correct syntax.