WITH predvyber AS ( SELECT Users.Id, Users.DisplayName, P...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

WITH predvyber AS (
  SELECT
    Users.Id,
    Users.DisplayName,
    Posts.Title,
    Posts.CreationDate,
    Posts.ViewCount
  FROM
    Posts
  JOIN
    Users ON Posts.OwnerUserId = Users.Id
  WHERE
    Posts.PostTypeId = 1
    AND Posts.CreationDate > '2023-11-01'
    AND Posts.ViewCount > 1
  ORDER BY
    Users.Id,
    Posts.ViewCount DESC
  OFFSET 0 rows
)

SELECT
  predvyber.*
FROM
  predvyber
WHERE
  (SELECT
     COUNT(*)
   FROM
     predvyber AS pocitadlo
   WHERE
     pocitadlo.Id = predvyber.Id
  ) < 4;

Enter Parameters

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