Created
December 6, 2022 02:58
-
-
Save judell/a278ce0c49f5bcf670b392cd21c7ace9 to your computer and use it in GitHub Desktop.
find followers and follows not on lists
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
with data as ( | |
select | |
l.title as list, | |
a.* | |
from | |
mastodon_list l | |
join | |
mastodon_list_account a | |
on | |
l.id = a.list_id | |
), | |
no_list_following as ( | |
select | |
d.list, | |
f.id, | |
f.username, | |
f.display_name | |
from | |
mastodon_following f | |
left join | |
data d | |
on | |
f.id = d.id | |
where | |
list is null | |
), | |
no_list_followers as ( | |
select | |
d.list, | |
f.id, | |
f.username, | |
f.display_name | |
from | |
mastodon_followers f | |
left join | |
data d | |
on | |
f.id = d.id | |
where | |
list is null | |
) | |
select * from no_list_following | |
union | |
select * from no_list_followers | |
order by id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment