Q&A for Drupal developers and administrators
SELECT TOP 1000 CreationDate, ShorteningService, id AS [Post Link] FROM ( SELECT id, CreationDate, CASE WHEN LOWER(body) LIKE '%//goo.gl/%' THEN 'goo.gl' WHEN LOWER(body) LIKE '%//bit.ly/%' THEN 'bit.ly' WHEN LOWER(body) LIKE '%//t.co/%' THEN 't.co' END AS ShorteningService FROM posts ) t WHERE ShorteningService IS NOT NULL ORDER BY CreationDate DESC