SELECT CASE CHARINDEX(' ', Answer.Body, 1) WHEN 0 THEN A...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Game Development Meta

Q&A about the site for professional and independent game developers

-- Enter Query Title
-- Enter Query Description

SELECT CASE CHARINDEX(' ', Answer.Body, 1)
            WHEN 0
            THEN Answer.Body
            ELSE SUBSTRING(Answer.Body, 1, CHARINDEX(' ', Answer.Body, 1)-1)
       END AS Language
FROM Posts AS Question, Posts AS Answer, Tags, PostTags
WHERE Answer.ParentId = Question.Id
AND PostTags.PostId = Question.Id
AND PostTags.TagId = Tags.Id
AND Tags.TagName = 'code-golf'

Enter Parameters

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