I am currently trying to write a sql script that would return a single line of data and not multiple lines.
I am trying to do a count on +- 4 statuses
1.In Process
2.Processing
3.Completed
4.Failed
my table has the following columns
ProcessId
StatusId
Interfaceid
date
the issue i am having is that the data being returned is being returned in multiple rows so eg
lets say i am doing a query on Ineterface 1 the result being returned is
RowNumber interfaceid in process processing completed failed
1 1 5
2 1 9
3 1 250
4 1 50
I want the result to show
RowNumber interfaceid in process processing completed failed
1 1 5 9 250 50
the script i am running is below
What I have tried:
Select
interfaceid,
decode(statusid,1,count(*))"in process",
decode(statusid,3,count(*))"processing",
decode(statusid,3,count(*))"completed",
decode(statusid,4,count(*))"Failed"
from table a
group by interfaceid,statusid