Find identical titles in a given tag (Trilogy version)

0

Please login or register to vote for this query.

(click on this box to dismiss)

We exclude closed questions, and also show the creation date of the posts. This works only in the trilogy sites (SO, SU, SF, MSO) and some SE 2.0 sites (mathematics, gis, webapps, stats, stackapps, gamedev, webmasters), not in most others of SE 2.0. Use http://data.stackexchange.com/ubuntu/s/1809 there. (Replace ubuntu with your site name.)

Drupal Answers

Q&A for Drupal developers and administrators

-- Find identical titles in a given tag (Trilogy version)
-- We exclude closed questions, and also show the creation date of the posts.
-- This works only in the trilogy sites (SO, SU, SF, MSO) and some SE 2.0 sites
-- (mathematics, gis, webapps, stats, stackapps, gamedev, webmasters),
-- not in most others of SE 2.0.
-- 
-- Use  http://data.stackexchange.com/ubuntu/s/1809  there
-- (replace ubuntu with your site name).

DECLARE @tag nvarchar(25) = ##tag:string##;
DECLARE @tagpattern nvarchar(25) = '%<' + LOWER(@tag) + '>%';

SELECT a.Id AS [Post Link], a.CreationDate AS "First Date",
       b.Id AS [Post Link], b.CreationDate AS "Second Date"
FROM Posts AS a JOIN Posts AS b ON a.Title = b.Title
WHERE a.Id < b.Id
  and (a.Tags like @tagpattern or b.Tags like @tagpattern)
  and a.ClosedDate IS NULL
  and b.ClosedDate IS NULL;

Enter Parameters

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