Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started