select * from Posts p left join Comments c on p.Id = c.Po...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Martial Arts Meta

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

Enter Parameters

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