All pastes #2069482 Raw Edit

Mine

public text v1 · immutable
#2069482 ·published 2011-05-26 14:55 UTC
rendered paste body
        $stmt = "SELECT
                    CASE WHEN sup_iss_id > 0 THEN 'associated' ELSE 'unassociated' END AS type,
                    COUNT(*) AS total_items
                 FROM
                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email,
                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "email_account
                 WHERE
                    sup_ema_id=ema_id AND
                    ema_prj_id=$prj_id AND
                    sup_removed=0
                 GROUP BY
                    type";