Retrieve Suggested Tags Based on 4 tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta query for: http://meta.stackoverflow.com/questions/271397/tag-combinations-that-suggest-re-tagging-automatically

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @Tag1 nvarchar(25) = '##Tag1##'
DECLARE @Tag2 nvarchar(25) = '##Tag2##'
DECLARE @Tag3 nvarchar(25) = '##Tag3##'
DECLARE @Tag4 nvarchar(25) = '##Tag4##'

SELECT * FROM Tags
WHERE TagName LIKE(@Tag1 + '-' + @Tag2)
   OR TagName LIKE(@Tag1 + '-' + @Tag3)
   OR TagName LIKE(@Tag1 + '-' + @Tag4)
   OR TagName LIKE(@Tag2 + '-' + @Tag1)
   OR TagName LIKE(@Tag2 + '-' + @Tag3)
   OR TagName LIKE(@Tag2 + '-' + @Tag4)
   OR TagName LIKE(@Tag3 + '-' + @Tag1)
   OR TagName LIKE(@Tag3 + '-' + @Tag2)
   OR TagName LIKE(@Tag3 + '-' + @Tag4)
   OR TagName LIKE(@Tag4 + '-' + @Tag1)
   OR TagName LIKE(@Tag4 + '-' + @Tag2)
   OR TagName LIKE(@Tag4 + '-' + @Tag3)

Enter Parameters

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