posts with more image markdown than html images

2

Please login or register to vote for this query.

(click on this box to dismiss)

Super User

Q&A for computer enthusiasts and power users

select postid as [Post Link],
mdi.numimages as numMarkdownImages,
hi.numimages as NumHtmlImages
from


(select postid,len(markdown) - len(replace(markdown, '![', 'X')) as numimages
from
(select ph.text as markdown,ph.postid as postid from
posthistory as ph
join 
(select max(id) as id from posthistory where
(posthistorytypeid = 2 or posthistorytypeid = 5 or posthistorytypeid = 8) 
group by postid) as latestid
on latestid.id = ph.id) as md) as mdi

join

(
select id,len(body) - len(replace(body, '<img src', '<img sr')) as numimages
from posts
) as hi
on mdi.postid = hi.id

where mdi.numimages > 0 and mdi.numimages > hi.numimages

Enter Parameters

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