Q&A about the site for students and teachers of all martial arts
select * 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