數據庫佔比連表分組降序分頁查詢例子

表結構與關聯關係如下圖: SELECT p.name AS package_name, COUNT(o.id) AS package_order_count, COUNT(o.id)/(SELECT COUNT(id) FROM t_order) AS proportion FROM t_package AS p INNER JOIN t_order AS o ON p.id=o.package_
相關文章
相關標籤/搜索