Answers that are possibly link only which were posted by new users and question asker is new

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
    p.Id AS [Post Link],
    p.CreationDate,
    LEN(p.Body) AS BodyLength
FROM
    Posts AS p
INNER JOIN
    Users AS u
ON
    u.Id = p.OwnerUserId
INNER JOIN
    Posts AS parentPost
ON
    parentPost.Id = p.ParentId
INNER JOIN
    Users AS parentUser
ON
    parentUser.Id = parentPost.OwnerUserId
WHERE
    p.PostTypeId = 2
  AND
    p.Body like '%a href%'
  AND
    p.CreationDate > '2014-01-01T00:00:00.000'
  AND
     DATEDIFF(WEEK, u.CreationDate, p.CreationDate) < 1
  AND
     DATEDIFF(WEEK, parentUser.CreationDate, p.CreationDate) < 1
  AND
  DATEDIFF(DAY, p.CreationDate, parentPost.CreationDate) < 1
  AND
  parentUser.Id != p.OwnerUserId
  
ORDER BY
    p.CreationDate DESC

Enter Parameters

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