Part 1 of 2: In this article, we will explore a developer's experience moving from writing SQL queries to NoSQL queries for analytics. We will divide this article into two parts. First part will cover SQL section. PS: Readers should have in-depth kno...
Markdown supported · ⌘↵ to post
Nice article!
The query can also be written as:
SELECT actor_name AS actorName, Sum(CASE WHEN acr.rating_name = 'excellent' THEN 1 ELSE 0 END) AS total_excellent, Sum(CASE WHEN acr.rating_name = 'better' THEN 1 ELSE 0 END) AS total_better, Sum(CASE WHEN acr.rating_name = 'good' THEN 1 ELSE 0 END) AS total_good FROM actor_survey acs LEFT JOIN actor_rating acr ON acs.rating_id = acr.id GROUP BY actornameBut I understand the posted query is for the sake of the purpose of this article series. :D