select
count( case when UserDefine1 = '07:30 - 19:00' then 1 end ) as `07:30-19:00`
, count( case when UserDefine1 = '19:00 - 06:30' then 1 end ) as `19:00-06:30`
from .....
where .....
หรือ
Code (SQL)
select
count( case when UserDefine1 = '07:30 - 19:00' then 1 else null end ) as `07:30-19:00`
, count( case when UserDefine1 = '19:00 - 06:30' then 1 else null end ) as `19:00-06:30`
from .....
where .....