Order results from SQLite table according to number of occurences of the id in another table in Sequel

24 Views Asked by At

So, the SQL code I made to complete this query is as below:

SELECT stories.*, COUNT(*) AS v
FROM stories, views
WHERE stories.story_id = views.story_id
GROUP BY stories.story_id
ORDER BY v DESC;

How would I translate this into Sequel?

0

There are 0 best solutions below