1.
SELECT
2.
count
(
case
when
w_status =
'y'
then
1
else
0
end
)
as
c_y,
3.
count
(
case
when
w_status =
'n'
then
1
else
0
end
)
as
c_n,
4.
count
(
case
when
w_status =
'i'
then
1
else
0
end
)
as
c_i
from
view_working
5.
where
w_date
BETWEEN
'$date1'
AND
'$date2'
and
w_status=
'y'
group
by
e_id
order
by
c_y
desc
LIMIT 12