1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Is there a way I could receive a SUM of each column and AVG balance amount SERIOUSLY...

Discussão em 'Outras Linguagens' iniciado por Stack, Agosto 4, 2021.

  1. Stack

    Stack Membro Participativo

    SELECT golf_card_id, AVG(balance_amount), SUM(balance_amount)
    FROM
    (SELECT gc.golf_card_id, gc.claims_id, o.id AS order_id, gc.merchandise_id, b.id as Balls_ID, o.balance_amount
    FROM m_golf_card_value_additions as gc
    JOIN m_orders AS o ON gc.order_id=o.id
    JOIN m_bundles as b on o.bundle_id=b.id
    where gc.merchandies_id = '392476' AND complaint = 'disputed_successfully'
    group by 1,2,3,4,5,6) GCV
    GROUP BY 1`


    I am attempting to receive the sum of each column and also the average of balance amount. Can anyone help?? Been stuck for hours trying to find the correct query to answer a question

    Continue reading...

Compartilhe esta Página