|
農薬通称で一括する場合は農薬数が少ないので、当面 MAX 関数を使わずに希釈倍数でグルーピングして、希釈倍数が異なるモノを全て列挙するようにした方が間違いがないですね。
ついでに、「きゅうり」ならなんでもではなく、「きゅうり」と「きゅうり(施設栽培)」だけにしてみました。
select shurui, tsusho, baisu, jiki, kaisu,
max(case byochu when "べと病" then "●" else "" end) as beto,
max(case byochu when "灰色かび病" then "●" else "" end) as haikabi,
max(case byochu when "うどんこ病" then "●" else "" end) as udonko,
max(case byochu when "斑点細菌病" then "●" else "" end) as hanten,
max(case byochu when "褐斑病" then "●" else "" end) as kappan,
max(case byochu when "菌核病" then "●" else "" end) as kinkaku
from tekiyo where (sakumotsu = "きゅうり" or sakumotsu = "きゅうり(施設栽培)") and hoho = "散布" and shurui not like "%粉剤" and shurui not like "%粒剤" and
(byochu = "べと病" or byochu = "灰色かび病" or byochu = "うどんこ病" or byochu = "斑点細菌病" or byochu = "褐斑病" or byochu = "菌核病")
group by baisu, tsusho order by shurui
|
|