Q&A for scientists using computers to solve scientific problems
SELECT top 100 p.Id, p.Score, p.ViewCount, p.OwnerUserId, p.CommentCount, p.FavoriteCount, (CASE WHEN EXISTS(SELECT 1 FROM posts aa WHERE aa.AcceptedAnswerId = p.id) THEN 1 ELSE 0 END) AS IsAcceptedAnswer from posts p where postTypeId = 2 --select * from posttypes -- 1 = question -- 2 = answer