s-count-ratioไม่จำเป็นต้องใช้ตารางทั้งหมด
s-count-ratioIt is not neccessary to use all the tables.
 PostTypes:  Id [ number]  Name [ text] 
SELECT u.Id AS "user_link", u.DisplayName, u.Reputation, COUNT(p.Id) AS "posts_count", (CAST(u.Reputation AS FLOAT) / CAST(COUNT(p.Id) AS FLOAT)) AS "ratio" FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE (p.PostTypeId = 1 OR p.PostTypeId = 2) AND u.Id = '##UserId:int##' GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY Ratio DESC LIMIT 1