How can I sort answers that comprise at least 1 picture by votes?

0

Please login or register to vote for this query.

(click on this box to dismiss)

https://meta.stackexchange.com/questions/353142/

Mathematics

Q&A for people studying math at any level and professionals in related fields

select top 1000
       a.id as [Post Link]
     , a.creationdate
     , a.score
     , len(text)-len(replace(text,' ','')) [~ word count]
from posts a
inner join posts q on q.id = a.parentid
inner join (
select postid, 
       text
from posthistory phi
where id = (select max(id) 
            from posthistory ph
            where ph.postid = phi.postid
            and ph.posthistorytypeid in (2,5,8))
) md on md.postid = a.id
where a.posttypeid = 2 -- answers
and (
  md.text like '%![[]%][[]%]%' 
  --or 
  --md.text like '%![%](%)%' or 
  --md.text like '%<img src="%"%'
  )
order by 4 desc

Enter Parameters

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