Q&A for power users of Apple hardware and software
DECLARE @MaxTextBeforeCode AS INT = ##MaxTextBeforeCode:int?0##; DECLARE @MaxTextAfterCode AS INT = ##MaxTextAfterCode:int?0##; SELECT Id AS [Post Link], Score, CreationDate FROM Posts WHERE PostTypeId = 2 -- answers AND CHARINDEX('<pre><code>', BODY) < @MaxTextBeforeCode AND CHARINDEX('</code></pre>', Body) + LEN('</code></pre>') = LEN(Body) AND ClosedDate IS NULL ORDER BY CreationDate