Search SO Answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Korean Language

Q&A for linguists, teachers and students of the Korean language

DECLARE @SearchText VARCHAR(100) = ##SearchText:string##
DECLARE @OnlyBeginning BIT = ##OnlyBeginning:int##
DECLARE @IncludeDeleted BIT = ##IncludeDeleted:int##
DECLARE @After DATETIME = ##After:string##

SELECT TOP 100
  Id AS [Post Link],
  CreationDate,
  Body,
  IIF(DeletionDate IS NOT NULL, 'Yes', 'No') AS Deleted
FROM Posts
WHERE PostTypeId = 2
AND 
  (
    (@IncludeDeleted = 0 AND DeletionDate IS NULL) 
    OR 1=1
  )
AND
  (
    (@OnlyBeginning = 1 AND Body LIKE @SearchText + '%') 
    OR (Body LIKE '%' + @SearchText + '%')
  )
AND (CreationDate > @After)
ORDER BY CreationDate DESC

Enter Parameters

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