Untitled

mail@pastecode.io avatar
unknown
plain_text
23 days ago
455 B
1
Indexable
Never
SELECT
    transaction_date,
    agent_inn_dil,
    client_inn_dil,
    client_name_dil,
    total_monthly_litres_dil,
    CASE WHEN label = 'dil_MO' OR label = 'dil_MO+KP' THEN total_monthly_ton_GZPN ELSE 0 END AS total_monthly_ton_GZPN_dealer_MO,
    CASE WHEN label = 'dil_KP' OR label = 'dil_MO+KP' THEN total_monthly_ton_GZPN ELSE 0 END AS total_monthly_ton_GZPN_dealer_KP,
    okved_client,
    label
INTO #dealer_MO_KP_modified
FROM #dealer_MO_KP;
Leave a Comment