hook_name条件に基づいて、SQL 選択クエリを介して別の列を動的に追加したいと考えています。
たとえば、 の場合hook_type = 0、テーブルhook_nameの値は である必要がありOFFER、同様に のhook_type = 1場合hook_nameは「ACCEPT」と表示される必要があります。
以下は結果のスクリーンショットです。
選択クエリは次のとおりです。
select hook_type, 'hook name' as hook_name,
count(*) as number_of_exchange_activities
from `exchange`
group by hook_type # hook_type 0 for OFFER, 1 for ACCEPT and 2 for offer EXPIRED;
前もって感謝します。
