0
<code>
select t.range as [Type], count(*) as [Value]
from (select case
when answer_count between 0 and 5 then 'PCS'
when answer_count between 5 and 10 then 'PRINTER'
else 'KEYBOARD' end as range
from points where type='product_quiz') t
group by t.range
</code>
Output is: --------------------- Type | Value --------------------- PCS 129195 PRINTER 121327 OTHERS 236548 I want to echo only for the printer value using PHP. For example I want the result like this: echo $printer = '121327';
應該在'SQL'簡單'Where'條款。 '..)t其中t.range ='PRINTER'組由t.range' –
嗨,我不想用sql來實現這一點,我需要在PHP中得到結果。 – Poornima