I know maybe my question is kinda weird but I didn't use Oracle before, I have this statement to select count of specific number in column and output result
select count(*)as Step1 from ALLVALUES WHERE NAME LIKE '%VALUE%' AND systime between caltosys(&t1) and caltosys(&t2) AND ROWNUM <= 90000 AND VALUE ='48'
This will output the results like this
------
Step1
------
20
------
I need to fetch multiple conditions and put each result in column for example
select count(*)as Step1 from ALLVALUES WHERE NAME LIKE '%VALUE%' AND systime between caltosys(&t1) and caltosys(&t2) AND ROWNUM <= 90000 AND VALUE ='48'
select count(*)as Step2 from ALLVALUES WHERE NAME LIKE '%VALUE%' AND systime between caltosys(&t1) and caltosys(&t2) AND ROWNUM <= 90000 AND VALUE ='49'
...
And output belike this
------------------------------
Step1 | Step2 | Step3 | Step4
------------------------------
20 | 5 | 1 | 4
------------------------------
Is that possible in my current situation?
I tried to write as suggested statement
select to_char(systocal(systime),'yyyy-mm-dd hh24:mi:ss.ff3') as Time,
COUNT(case WHEN value ='48.8' then value end) as Step1,
COUNT(CASE WHEN value ='48.75' then value end) as Step2,
COUNT(CASE WHEN value ='48.7' then value end)as Step3,
COUNT(CASE WHEN value ='48.68' then value end)as Step4,
COUNT(CASE WHEN value ='48.6' then value end)as Step5,
COUNT(CASE WHEN value ='48.58' then value end)as Step6,
COUNT(CASE WHEN value ='48.55' then value end)as Step7,
COUNT(CASE WHEN value ='48.52' then value end)as Step8,
from MEA where ID = 5570 AND systime between caltosys(&t1) and caltosys(&t2) AND ROWNUM <= 100
&t1 - &t2 are variables for time
But keep giving me missing expression 936