ผมต้องการทำรายงานสรุป ภาวะโภชนาการ ตามเกณฑ์ "อายุ/ต่อน้ำหนัก" ผมต้องเขียน sql ตามด้านล่างนี้ถูกต้องไหมครับ
SELECT
(select count(nutrition_level) from person_wbc_nutrition where nutrition_level=0 and nutrition_date BETWEEN '2011-10-01' AND '2011-10-30' ) as level0 ,
(select count(nutrition_level) from person_wbc_nutrition where nutrition_level=1 and nutrition_date BETWEEN '2011-10-01' AND '2011-10-30' ) as level1 ,
(select count(nutrition_level) from person_wbc_nutrition where nutrition_level=2 and nutrition_date BETWEEN '2011-10-01' AND '2011-10-30' ) as level2 ,
(select count(nutrition_level) from person_wbc_nutrition where nutrition_level=3 and nutrition_date BETWEEN '2011-10-01' AND '2011-10-30' ) as level3 ,
(select count(nutrition_level) from person_wbc_nutrition where nutrition_level=4 and nutrition_date BETWEEN '2011-10-01' AND '2011-10-30' ) as level4 ,
(select count(nutrition_level) from person_wbc_nutrition where nutrition_level=5 and nutrition_date BETWEEN '2011-10-01' AND '2011-10-30' ) as level5
FROM
person_wbc_nutrition
LIMIT 1