Read history for a particular category

Is there a way to write this specific query:

  • For topics in category (category id: 34) viewed by user(s) not in group (executive_board)
    • Display user, display topic, display when viewed.

من المضحك أن هذا تم دفعه تلقائيًا. وهو ذو صلة كافية مرة أخرى لدرجة أنني أود لو كان لدى شخص ما إجابة

إعجاب واحد (1)

نعم، يبدو أنك انتظرت طويلاً لهذا. :slight_smile:

أعتقد أن شيئًا كهذا قد ينجح؟ (ستحتاج إلى العثور على group_id لمجلسك التنفيذي وتبديله بـ group_id = 3)

SELECT tu.user_id,
       tu.topic_id,
       tu.last_read_post_number,
       tu.last_visited_at AS read
FROM topics t
LEFT OUTER JOIN topic_users tu ON t.id = tu.topic_id
WHERE tu.user_id NOT IN (SELECT user_id
    FROM group_users
    WHERE group_id = 3)
AND t.category_id = 34
AND tu.last_visited_at IS NOT NULL
ORDER BY tu.last_visited_at DESC
إعجاب واحد (1)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.