¿Es posible ver los temas que ha visto un usuario?

Tal vez algo como:

Quién (usuario conectado) ve un tema específico

-- [parámetros]
-- int :topic_id = 1

SELECT
    title,
    viewed_at,
    tv.user_id
FROM topics t
LEFT JOIN topic_views tv
    ON t.id = tv.topic_id
WHERE category_id IS NOT NULL
    AND tv.user_id IS NOT NULL
    AND t.id = :topic_id
ORDER BY viewed_at DESC
LIMIT 1000

Últimas 100 vistas de temas por usuario

-- [parámetros]
-- int :user_id = 1

SELECT
    tv.user_id,
    title,
    viewed_at,
    views,
    t.user_id
FROM topics t
LEFT JOIN topic_views tv
    ON t.id = tv.topic_id
WHERE category_id IS NOT NULL
    AND tv.user_id = :user_id
ORDER BY viewed_at DESC
LIMIT 100
10 Me gusta