Q&A for professional and enthusiast programmers
select distinct p.Id as Id, p.OwnerUserId as UserId, case when t.tagName like 'amazon-%' then 'aws' when t.tagName like 'aws-%' then 'aws' end as platform from Tags t JOIN PostTags pt ON t.Id = pt.TagId JOIN Posts p ON p.Id = pt.PostId --and p.PostTypeId = 1 -- PostTypeId 1: Question where t.TagName like 'amazon-%' or t.TagName like 'aws-%'