Don't touch my junk.

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

DECLARE @Tag1 NVARCHAR(25) = ##Tag1:String?java##;
DECLARE @Tag2 NVARCHAR(25) = ##Tag2:String?java##;
DECLARE @Tag3 NVARCHAR(25) = ##Tag3:String?java##;
DECLARE @SortOrder NVARCHAR(4) = ##SortOrder:String?DESC##;

DECLARE @sql NVARCHAR(MAX) = N'SELECT DISTINCT
    [Post Link] = Posts.Id
  , [Creation Date] = Posts.CreationDate
  , [Tags] = Tags.TagName
  
FROM Posts
  INNER JOIN PostTags 
    ON Posts.Id = PostTags.PostId
    AND Posts.AnswerCount = 0
    AND Posts.ClosedDate IS NULL
  INNER JOIN Tags 
    ON Tags.Id = PostTags.TagId

WHERE 
  Tags.TagName IN (''' + @Tag1 + ''', ''' + @Tag2 + ''', ''' + @Tag3 + ''')

ORDER BY Posts.CreationDate DESC';

execute (@sql);

Enter Parameters

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