CUSTOMERS.sql

    0

    0

    SELECT c.customer_name, ROUND(SUM(i.total_price), 6)
    FROM customer c
    INNER JOIN invoice i ON c.id=i.customer_id
    GROUP BY c.customer_name
    HAVING SUM(i.total_price)<0.25*(SELECT AVG(total_price) FROM invoice)
    ORDER BY ROUND(SUM(i.total_price), 6) DESC
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.