שאילתה ב-Data explorer לרשימת הנושאים עם "זמן קריאה משוער" הארוך ביותר?

I’ve had another go. :slightly_smiling_face: I’m not 100% on this one, as I don’t have a large enough sample to test it against, but it’s picked up my test topics. :+1:

-- [params]
-- integer :limit = 10

WITH read_time AS (
SELECT t.id as topic_id, 
(t.word_count)/500+1 as word_count_time, 
(t.posts_count*4)/60+1 as post_count_time
FROM topics t
WHERE t.word_count IS NOT NULL
AND t.archetype = 'regular'
AND t.deleted_at IS NULL
)

SELECT topic_id, CONCAT (CASE WHEN word_count_time > post_count_time THEN word_count_time ELSE post_count_time END, ' min') AS estimated_reading_time 
FROM read_time
ORDER BY estimated_reading_time DESC
LIMIT :limit