Q&A about the site for enthusiasts and scholars of mythology and folklore
SELECT p.Id AS [Post Link], p.Title, p.Score, p.ViewCount, p.CreationDate, p.Tags, LEFT(p.Body, 200) + '...' AS BodyPreview, ( SELECT COUNT(*) FROM STRING_SPLIT( REPLACE( REPLACE(p.Body, '![', CHAR(13) + '!['), '<img', CHAR(13) + '<img' ), CHAR(13) ) WHERE value LIKE '<img%' OR value LIKE '![%' ) AS ImageCount FROM Posts p WHERE (p.Title LIKE '%architect%' OR p.Body LIKE '%architect%') AND p.PostTypeId = 1 -- Questions only AND p.CreationDate >= DATEADD(MONTH, -1, GETDATE()) -- Last 6 months only AND p.Score >= 0 -- Include all non-negative scored posts AND ( p.Body LIKE '%<img%' -- HTML image tags OR p.Body LIKE '%![%]%' -- Markdown image syntax ) ORDER BY p.Score DESC, p.CreationDate DESC