SELECT
IF(duty_type_timein LIKE '%-01 %', conclude,'') as D01
,IF(duty_type_timein LIKE '%-02 %', conclude,'') as D02
,IF(duty_type_timein LIKE '%-03 %', conclude,'') as D03
,IF(duty_type_timein LIKE '%-04 %', conclude,'') as D04
,IF(duty_type_timein LIKE '%-05 %', conclude,'') as D05
,IF(duty_type_timein LIKE '%-06 %', conclude,'') as D06
,IF(duty_type_timein LIKE '%-07 %', conclude,'') as D07
,IF(duty_type_timein LIKE '%-08 %', conclude,'') as D08
,IF(duty_type_timein LIKE '%-09 %', conclude,'') as D09
,IF(duty_type_timein LIKE '%-10 %', conclude,'') as D10
,IF(duty_type_timein LIKE '%-11 %', conclude,'') as D11
,IF(duty_type_timein LIKE '%-12 %', conclude,'') as D12
,IF(duty_type_timein LIKE '%-13 %', conclude,'') as D13
,IF(duty_type_timein LIKE '%-14 %', conclude,'') as D14
,IF(duty_type_timein LIKE '%-15 %', conclude,'') as D15
,IF(duty_type_timein LIKE '%-16 %', conclude,'') as D16
,IF(duty_type_timein LIKE '%-17 %', conclude,'') as D17
,IF(duty_type_timein LIKE '%-18 %', conclude,'') as D18
,IF(duty_type_timein LIKE '%-19 %', conclude,'') as D19
,IF(duty_type_timein LIKE '%-20 %', conclude,'') as D20
,IF(duty_type_timein LIKE '%-21 %', conclude,'') as D21
,IF(duty_type_timein LIKE '%-22 %', conclude,'') as D22
,IF(duty_type_timein LIKE '%-23 %', conclude,'') as D23
,IF(duty_type_timein LIKE '%-24 %', conclude,'') as D24
,IF(duty_type_timein LIKE '%-25 %', conclude,'') as D25
,IF(duty_type_timein LIKE '%-26 %', conclude,'') as D26
,IF(duty_type_timein LIKE '%-27 %', conclude,'') as D27
,IF(duty_type_timein LIKE '%-28 %', conclude,'') as D28
,IF(duty_type_timein LIKE '%-29 %', conclude,'') as D29
,IF(duty_type_timein LIKE '%-30 %', conclude,'') as D30
,IF(duty_type_timein LIKE '%-31 %', conclude,'') as D31
FROM duty_person
where type='W'
and duty_type_timein LIKE '2015-08%'
and duty_type_timeout!=''
and user_id = '91'
and status_duty!='3'