Finding bad answers through comments

0

Please login or register to vote for this query.

(click on this box to dismiss)

A lexical search method

Network Engineering

Q&A for network engineers

select p.Id,p.Title,p.CommentCount,p.Body,c.Text
from Posts p left join Comments c 
on p.Id = c.PostId 
where
(REPLACE(LTRIM(RTRIM(p.Title)),' ','') like '%##key##%' or REPLACE(LTRIM(RTRIM(p.Title)),'','') like '%##Method##%') 
and((REPLACE(LTRIM(RTRIM(p.Body)),' ','') like '%##key##%' and REPLACE(LTRIM(RTRIM(p.Body)),'','') like '%##Method##%')
or(REPLACE(LTRIM(RTRIM(c.Text)),' ','') like '%##key##%' and REPLACE(LTRIM(RTRIM(c.Text)),'','') like '%##Method##%'))
and(( REPLACE(LTRIM(RTRIM(p.Body)),' ','') like '%js%')or(REPLACE(LTRIM(RTRIM(c.Text)),' ','') like '%js%'))
order by p.Id

Enter Parameters

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