parent
17020218e8
commit
f27731e66c
@ -1 +1 @@ |
||||
2027 |
||||
2028 |
@ -0,0 +1,2 @@ |
||||
select b."Id", b."TotalThreads", t.cnt from "Boards" b join (select "BoardId", count(*) cnt from "Threads" group by "BoardId") t on t."BoardId" = b."Id" where (select count(*) from "Boards" sb where sb."ParentBoardId" = b."Id") = 0 and b."TotalThreads" != t.cnt; |
||||
select b."Id", b."TotalThreads", sb.total, t.cnt, sb.total + t.cnt from "Boards" b join (select "ParentBoardId", sum("TotalThreads") total from "Boards" group by "ParentBoardId") sb on sb."ParentBoardId" = b."Id" join (select "BoardId", count(*) cnt from "Threads" group by "BoardId") t on t."BoardId" = b."Id" where b."TotalThreads" != sb.total+t.cnt; |
Loading…
Reference in new issue