Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfb62cf
commit cfba7c1
Showing
6 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SELECT TRUNCATE(weight, -1), COUNT(id) FROM | ||
(SELECT posts.id, posts.is_tp, SUM(reasons.weight) AS weight FROM posts INNER JOIN posts_reasons ON posts.id = posts_reasons.post_id | ||
INNER JOIN reasons ON posts_reasons.reason_id = reasons.id GROUP BY posts.id) AS posts_weights | ||
WHERE is_tp = 0 | ||
GROUP BY TRUNCATE(weight, -1) | ||
ORDER BY TRUNCATE(weight, -1) ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
SELECT TRUNCATE(weight, -1), COUNT(id) FROM | ||
(SELECT posts.id, posts.is_tp, SUM(reasons.weight) AS weight FROM posts INNER JOIN posts_reasons ON posts.id = posts_reasons.post_id | ||
INNER JOIN reasons ON posts_reasons.reason_id = reasons.id GROUP BY posts.id) AS posts_weights | ||
GROUP BY TRUNCATE(weight, -1) | ||
ORDER BY TRUNCATE(weight, -1) ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SELECT TRUNCATE(weight, -1), COUNT(id) FROM | ||
(SELECT posts.id, posts.is_tp, SUM(reasons.weight) AS weight FROM posts INNER JOIN posts_reasons ON posts.id = posts_reasons.post_id | ||
INNER JOIN reasons ON posts_reasons.reason_id = reasons.id GROUP BY posts.id) AS posts_weights | ||
WHERE is_tp = 1 | ||
GROUP BY TRUNCATE(weight, -1) | ||
ORDER BY TRUNCATE(weight, -1) ASC; |