Questions tagged with visual-studio-code and <other thing>

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 AS NVARCHAR(60) = ##Tag1:string? ##;
DECLARE @tag2 AS NVARCHAR(60) = ##Tag2:string? ##;

-- DECLARE @username AS NVARCHAR(60) = ##DisplayName:string? ##;
-- DECLARE @userId AS INT = ##UserId:int?-1##;

WITH Questions AS (
  SELECT *
  FROM Posts
  WHERE PostTypeId = 1
--    AND (@userId < 0 OR OwnerUserId = @userId)
--    AND (@username = '' OR OwnerUserId IN (
--        SELECT Id
--        FROM Users
--        WHERE DisplayName = RTRIM(LTRIM(@username))))
  )

SELECT TOP 10000
  Id [Post Link],
  Tags,
  Score,
  AnswerCount,
  CreationDate
FROM Questions
WHERE
  (@tag1 = '' OR LOWER(Tags) LIKE '%<' + LOWER(RTRIM(LTRIM(@tag1))) + '>%')
  AND (@tag2 = '' OR LOWER(Tags) LIKE '%<' + LOWER(RTRIM(LTRIM(@tag2))) + '>%')
ORDER BY CreationDate DESC

Enter Parameters

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