Created
December 18, 2021 16:14
-
-
Save suhlig/aba67dcb687992a7883e73b8c57df3e0 to your computer and use it in GitHub Desktop.
Create my list of #TopTenPodcasts2021
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
CAST(SUM(ZMEDIADURATION) / 60 / 60 AS INT) AS listened_hours, | |
ZPODCAST.ZTITLE as podcast, | |
ZURL as url | |
FROM | |
ZPODCAST, | |
ZPODCASTEPISODE | |
WHERE | |
ZPODCASTEPISODE.ZPODCASTFOREPISODE == ZPODCAST.Z_PK | |
AND | |
datetime(ZPLAYBACKLATEST + strftime('%s', '2001-01-01 00:00:00'), 'unixepoch') | |
> | |
datetime(strftime('%s', '2021-01-01 00:00:00'), 'unixepoch') | |
GROUP BY | |
ZPODCAST.ZTITLE | |
ORDER BY | |
SUM(ZMEDIADURATION) DESC | |
LIMIT | |
10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment