Answers for "sql pivot oracle"

SQL
5

sql pivot oracle

SELECT *        -- Total invoices per gender
FROM (
    SELECT invoice, gender
    FROM sales
) d
PIVOT (
    sum(invoice)
    FOR gender IN ('F' AS "Women", 'M' AS "Men")
);
-- Table Sales:
CREATE TABLE sales (
    gender VARCHAR2(1 BYTE),		-- 'F' or 'M'
    invoice NUMBER
);
Posted by: Guest on April-13-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language