create table #Link (Id nvarchar(max)) INSERT INTO #Link ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Gardening and Landscaping Meta

Q&A about the site for gardeners and landscapers

create table #Link (Id nvarchar(max))

INSERT INTO #Link (Id) VALUES ('218384')
INSERT INTO #Link (Id) VALUES ('513832')
INSERT INTO #Link (Id) VALUES ('5554734')
INSERT INTO #Link (Id) VALUES ('40480')
INSERT INTO #Link (Id) VALUES ('6343166')
INSERT INTO #Link (Id) VALUES ('13102045')
INSERT INTO #Link (Id) VALUES ('25706216')
INSERT INTO #Link (Id) VALUES ('2770321')
INSERT INTO #Link (Id) VALUES ('23353173')
INSERT INTO #Link (Id) VALUES ('409784')
INSERT INTO #Link (Id) VALUES ('29140402')
INSERT INTO #Link (Id) VALUES ('2591098')
INSERT INTO #Link (Id) VALUES ('19896870')
INSERT INTO #Link (Id) VALUES ('2745265')
INSERT INTO #Link (Id) VALUES ('2422468')
INSERT INTO #Link (Id) VALUES ('41577234')
INSERT INTO #Link (Id) VALUES ('10382929')
INSERT INTO #Link (Id) VALUES ('2559527')
INSERT INTO #Link (Id) VALUES ('153724')
INSERT INTO #Link (Id) VALUES ('4216745')
INSERT INTO #Link (Id) VALUES ('363681')
INSERT INTO #Link (Id) VALUES ('2839321')
INSERT INTO #Link (Id) VALUES ('4112686')
INSERT INTO #Link (Id) VALUES ('19843506')
INSERT INTO #Link (Id) VALUES ('223918')
INSERT INTO #Link (Id) VALUES ('18093928')
INSERT INTO #Link (Id) VALUES ('504103')
INSERT INTO #Link (Id) VALUES ('26446599')
INSERT INTO #Link (Id) VALUES ('3481828')
INSERT INTO #Link (Id) VALUES ('34413')

create table #duplicateChild (Title nvarchar(max),Id nvarchar(max),
Tags nvarchar(max), AAID int)

insert #duplicateChild 
SELECT TOP 50000
     Posts.Title
    , Posts.Id
--- , Posts.ViewCount
    , Posts.Tags
    , Posts.AcceptedAnswerId
FROM Posts 
INNER JOIN #Link ON Posts.Id =#Link.Id

SELECT #duplicateChild.Title, #duplicateChild.Tags, #duplicateChild.Id,
Posts.Body
From Posts
  INNER JOIN #duplicateChild ON Posts.Id =#duplicateChild.AAID
WHERE
    PostTypeId = 2

---SELECT * from #duplicateChild

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results