Q&A about the site for administrators, end users, developers and designers for Craft CMS
/*--find number of users who didn’t post any questions in year2015-- SELECT COUNT(DISTINCT u.Id) as 'who did not ask question' FROM Users u LEFT JOIN Posts p ON u.Id = p.OwnerUserId AND YEAR(p.CreationDate) = 2015 AND p.PostTypeId = (SELECT Id FROM PostTypes WHERE Name = 'Question') WHERE p.Id IS NULL;*/ --find number of post titles related to sports without any accepted answers-- SELECT COUNT(Id) as 'post about sports without any accepted answers' FROM Posts WHERE Title LIKE '%sports%' AND AcceptedAnswerId IS NULL;