SELECT u.Id AS UserId, p.Id AS Po...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

SELECT
    u.Id             AS UserId,
    p.Id             AS PostId,
    p.CreationDate
FROM Users u
INNER JOIN Posts p on u.Id = p.OwnerUserId
WHERE 1=1
    AND u.Id <> -1
    AND NOT EXISTS (SELECT p2.id FROM posts p2 WHERE p.OwnerUserID = p2.OwnerUserID AND p2.CreationDate > p.CreationDate)
ORDER BY p.CreationDate DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results