String search in Title/Tags/Body with a minimum score of 7 and without code in body

0

Please login or register to vote for this query.

(click on this box to dismiss)

Search for a string that occurs either in title, tags or body Posts need a minimum score of 7 and should be without code in body

Latin Language

Q&A for linguists, teachers, and students wanting to discuss the finer points of the Latin language

DECLARE @Text1 VARCHAR(100) = ##Text:string##; 
SET     @Text1             = '% '+LTRIM(RTRIM(@Text1))+' %';




SELECT    Id AS [Post Link], Score, Title 
FROM       Posts 
WHERE           
  (PostTypeId = 1) AND
     (Body LIKE '%<pre%><code>%') AND -- for block code with name --
     (Body LIKE '%<pre><code>%') AND -- just block code --
     (Body LIKE '%<pre>%<code>%') AND -- for pre -> new line -> code --
     (Posts.Score >= 7) AND -- change min score -
     ((lower(Posts.Tags) LIKE lower(@Text1)) OR
     (lower(Posts.Title) LIKE lower(@Text1)) OR
     (lower(Posts.Body) LIKE lower(@Text1))) 
     
     

ORDER BY   Score DESC

Enter Parameters

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