Select question Text

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

select * from (select pright.Id, pleft.PostId, pright.Comment, pleft.Text as OldText, pright.Text as NewText, 
pleft.CreationDate as Small, 
pright.CreationDate as Big,
Row_number() OVER(PARTITION BY pright.Id order by pleft.CreationDate DESC) as  rnq
from 
(select phis.Id, phis.PostId, phis.CreationDate, phis.Text from PostHistory as phis 
 inner join Posts p on p.Id = phis.PostId 
 where p.PostTypeId = 1
 and phis.PostHistoryTypeId = 5
 ) as pleft
 inner join (
     select phis.Id, phis.PostId, phis.Comment, phis.Text, phis.CreationDate from PostHistory as phis 
   inner join Posts p on p.Id = phis.PostId 
     where p.PostTypeId = 1 
    and phis.PostHistoryTypeId = 5
    and (/*lower(phis.Comment) like '%add%output%'*/
   lower(phis.Comment) like '%expect%output%'
    /*or lower(phis.Comment) like '%want%outptu%'*/
    )
    and lower(phis.Comment) not like '%log%'
     and lower(phis.Comment) not like '%error%'
    and lower(phis.Comment) not like '%code%'
     and lower(phis.Comment) not like '%clarify%'
     and lower(phis.Comment) not like '%format%'
     and lower(phis.Comment) not like '%title%'
     and lower(phis.Comment) not like '%tag%'
     /*and phis.Comment not like '%clarify%'*/
 ) as pright
on pleft.PostId = pright.PostId
where pleft.CreationDate < pright.CreationDate) t
where t.rnq = 1
/*order by timeinterval*/

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results