Answers for "sql group by used for"

SQL
0

SQL group by having clause

SELECT
    customer_id,
    YEAR (order_date),
    COUNT (order_id) order_count
FROM
    sales.orders
GROUP BY
    customer_id,
    YEAR (order_date)
HAVING
    COUNT (order_id) >= 2
ORDER BY
    customer_id;
Code language: SQL (Structured Query Language) (sql)
Posted by: Guest on May-04-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language