Question: Here is my code: SELECT section _ name, MAX ( IF ( EXTRACT ( YEAR FROM trunc _ month ) = 2 0 2 4
Here is my code:
SELECT
sectionname,
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS January
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS February
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS March
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS April
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS May
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS June
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS July
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS August
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS September
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS October
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS November
MAXIFEXTRACTYEAR FROM truncmonth AND EXTRACTMONTH FROM truncmonth totaldistinctusers, NULL AS December
FROM
productiondata.feboverallfeatureusage
GROUP BY
sectionname
order by sectionname
How do I remove the columns with NULLS in all rows ie the future months
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
