Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT
accounts.id
FROM accounts
LEFT JOIN users ON accounts.id=users.account_id
LEFT JOIN (
SELECT
account_id
FROM blocks
WHERE target_account_id=1
) AS blockers ON accounts.id=blockers.account_id
LEFT JOIN (
SELECT
account_id
FROM mutes
WHERE target_account_id=1
) AS muters ON accounts.id=muters.account_id
WHERE (accounts.domain IS NULL)
AND ((accounts.actor_type='Person') OR (accounts.actor_type IS NULL))
AND (accounts.silenced='f')
AND (accounts.suspended='f')
AND (blockers.account_id IS NULL)
AND (muters.account_id IS NULL)
AND (users.disabled='f')
GROUP BY accounts.id;
@pooza

This comment has been minimized.

Owner

pooza commented Dec 7, 2018

管理者のアカウントIDを1として。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment