Hi all guys i have a technical problem, i have a table with records like this:
DATE SIP DURATION TYPE
2017-02-22 670 9 NO ANSWER
2017-02-22 670 9 ANSWER
2017-02-22 670 9 ANSWER
2017-02-22 671 9 NO ANSWER
i'd like have result like this:
SIP DURATION NOANSWER ANSWER
670 18 1 2
671 9 1 0
i'll make query like this:
select
DISTINCT(SIP),
(select count(*) FROM table where TYPE="ANSWERED")
(select count(*) FROM table where TYPE="NO ANSWERED")
from table
but the result count all record on the table, is better use group by?
sorry i'm noob :( thanks for the time Marco