ถูกโพสต์แล้ว?.ไม่จำเป็นต้องใช้ตารางทั้งหมด
was posted?.It is not neccessary to use all the tables.
 Users:  Id [ number]  Reputation [ number]  CreationDate [ time]  DisplayName [ text]  LastAccessDate [ time]  WebsiteUrl [ text]  Location [ text]  AboutMe [ text]  Views [ number]  UpVotes [ number]  DownVotes [ number]  ProfileImageUrl [ text]  EmailHash [ text]  AccountId [ number] 
SELECT COUNT(*) AS "# questions", SUM(CASE WHEN DATEDIFF(day, q.CreationDate, CreationDate) >= @MinNumDays THEN 1 ELSE 0 END) AS "# marked as dup >= N days later", @MinNumDays AS "N (days)", CAST(SUM(CASE WHEN DATEDIFF(day, q.CreationDate, CreationDate) >= @MinNumDays THEN 1 ELSE 0 END) * 1.0 / COUNT(*) AS DECIMAL(3, 2)) AS fraction FROM Posts AS q JOIN PostHistory AS ph ON ph.PostId = q.Id JOIN CloseReasonTypes AS cr ON ph.PostId = q.Id WHERE q.PostTypeId = 1 AND ph.PostHistoryTypeId = 10 AND ph.Comment = 101 GROUP BY q.PostTypeId