SELECT
    {user_id} AS user_id,
    IFNULL(sum(repetition), 0) AS repetition,
    IFNULL(sum(news), 0) AS news,
    IFNULL(sum(imports), 0) AS imports,
    IFNULL(sum(olds), 0) AS olds,
    IFNULL(sum(today), 0) AS today
FROM
    cards_data_base
where
    user_id = {user_id}
and repetition