FROM THE WELP EXERCISE, NO 8
Sometimes on Welp, there are some old reviews that aren’t useful anymore.
Write a query using the
WITH clause to select all the reviews that happened in 2020.
places to your
WITH query to see a log of all reviews from 2020.
(This will use the
WITH clause as well as the
strftime() function. See if you can use Google to dig up some information about the function before take a look at the hint.)
So to achieve the result I used this query :
SELECT * FROM
ON reviews.place_id = places.id
WHERE strftime ("%Y", review_date) = ‘2020’
The results came out to what was demanded in the question 8. But then I tried alternate to verify because that was in the Hint section.
Issue is, this alternate query doesn’t return any result. What could be the issue with this ?
Would like to understand the if the first query’s result is same as the alternate query ?
WITH reviews2020 AS (
WHERE strftime("%Y", review_date) = ‘2020’
ON reviews.place_id = places.id;