Relative Content

Tag Archive for sqlmysqlunion

Why UNION and UNION ALL don’t work in my code?

select name as results from Users u RIGHT JOIN MovieRating r on r.user_id = u.user_id group by r.user_id order by count(*) desc, name limit 1 UNION ALL select title as results from Movies m RIGHT JOIN MovieRating r on r.movie_id = m.movie_id where created_at<‘2020-03-01’ group by r.movie_id order by avg(rating )desc, m.title asc limit 1 […]