Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help! Question #1 The SQL statement below has an error, please identify it and how to fix it SELECT Guest_ID, Property, extract (month from
Please help!
Question #1 The SQL statement below has an error, please identify it and how to fix it SELECT Guest_ID, Property, extract (month from cast (play_date as date)) as month, age group VIP grouping, Location, case when Frequency in ('a.48+') then 'Weekly when frequency in ('b.24-47', c. 12-23') then 'Monthly else 'Infrequent' end as Frequency, sum (case when extract (year from cast (play_date as date)) = 2020 then f_Rev_all end) as Rev_2020, sum (case when extract (year from cast (play_date as date)) = 2019 then f_Rev_all end) as Rev_2019, sum (case when extract (year from cast (play_date as date)) = 2020 then Total_offer_cost end) as Cost_2020, sum (case when extract (year from cast (play_date as date)) = 2019 then Total_offer_cost end) as Cost_2019 WHERE property = 'Tangiers' and extract (month from cast (play_date as date)) = 10 and extract (year from cast (play_date as date)) in (2019,2020) group by 1,2,3,4,5,6,7Step 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