Skip to content

What discord author responds most to questions in a specific discord guild?

Think for a sec how many queries can you generate from this? Work In Progress

SQL Query

select
    messages_t.msg_content,
    reply_count
from
(
    select 
        count(reply_to_message_id) as reply_count,
        reply_to_message_id
    from
        messages_t
    where
        is_bot = false
        and guild_id in (  (select id from guilds_t limit 1)  )
        and msg_content like '%?%'
    group by reply_to_message_id
    order by reply_count desc
) as reply_count_t
join messages_t on reply_count_t.reply_to_message_id = messages_t.reply_to_message_id


Similar Queries