Remaining posts with default alt-text - for markdown

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mi Yodeya

Q&A for those who base their lives on Jewish law and tradition and anyone interested in learning more

SELECT 
      '    http://mi.yodeya.com/q/' + ltrim(str(p.Id, 7))
     + REPLICATE('ߗ', 8 - LEN(p.Id)) -- Padding
     + convert(varchar(10), p.CreationDate, 102) + 'ߗߗߗ'
     + convert(varchar(10), p.LastActivityDate, 102) + 'ߗߗߗ'
     + str(p.score, 5)
     + str((case when p.posttypeid = 1 then p.viewcount else pparent.viewcount end), 7)
     as FormattedForMarkdown
FROM Posts p
LEFT OUTER JOIN Posts pparent
ON pparent.Id = p.ParentId
WHERE 
      (
          p.Body LIKE '%alt text%'
       OR p.Body LIKE '%enter image description here%'
      )
  AND 
      (
          p.Title IS NULL
       OR p.Title NOT LIKE '%alt text%' -- Exclude meta post discussing alt texts
      )
ORDER BY p.id asc

Enter Parameters

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