{"id":496823,"date":"2026-10-01T06:01:46","date_gmt":"2026-10-01T06:01:46","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=496823"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=496823","title":{"rendered":"\u041f\u043e\u0434\u044b\u0442\u043e\u0433\u0438 \u0438 \u0438\u0442\u043e\u0433\u0438 \u0441\u0432\u043e\u0434\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 Apache SuperSet: \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u043d\u0430 ClickHouse (\u0447\u0430\u0441\u0442\u044c 1)"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Superset \u0443\u043c\u0435\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0432\u043e\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b,\u00a0 \u043d\u043e \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u043e\u0432 \u0438 \u0438\u0442\u043e\u0433\u043e\u0432 (subtotals\/total) \u00a0\u0432 \u0441\u0432\u043e\u0434\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0441 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439  \u043c\u0435\u0442\u0440\u0438\u043a\u043e\u0439   \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0448\u044c\u0441\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c: \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u0410 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0430\u043c\u0438 \u0438 \u0438\u0442\u043e\u0433\u0430\u043c\u0438 \u2014 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u00a0\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0411\u0414 (ClickHouse).<\/p>\n<p>\u042f \u00a0\u043d\u0430\u0448\u043b\u0430 \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430: UNION \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u0418 \u043d\u0430\u0447\u043d\u0443 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 UNION.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u041f\u043e\u0442\u0435\u0440\u0438, %<\/p>\n<p>\u041f\u043e\u0442\u0435\u0440\u0438, % = \u041f\u043e\u0442\u0435\u0440\u0438, \u0448\u0442\/\u041f\u0440\u043e\u0434\u0430\u0436\u0438, \u0448\u0442<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u0442\u043e\u0433\u0438 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c SuperSet,<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2ef\/8b6\/2a1\/2ef8b62a1c2ad6389987b38538b951f9.png\" alt=\"\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 SuperSet\" title=\"\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 SuperSet\" width=\"266\" height=\"300\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/2ef\/8b6\/2a1\/2ef8b62a1c2ad6389987b38538b951f9.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2ef\/8b6\/2a1\/2ef8b62a1c2ad6389987b38538b951f9.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 SuperSet<\/figcaption><\/div>\n<\/figure>\n<p>\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. <\/p>\n<p>\u0412 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0430\u0445\/\u0438\u0442\u043e\u0433\u0430\u0445 \u0441\u043b\u043e\u0436\u0430\u0442\u0441\u044f \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c, \u0447\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c. <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ef9\/04c\/359\/ef904c359a0656da65303fa14d810925.png\" alt=\"\u0432\u0438\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0438\u0442\u043e\u0433\u043e\u0432 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 SupserSet\" title=\"\u0432\u0438\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0438\u0442\u043e\u0433\u043e\u0432 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 SupserSet\" width=\"624\" height=\"248\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/ef9\/04c\/359\/ef904c359a0656da65303fa14d810925.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ef9\/04c\/359\/ef904c359a0656da65303fa14d810925.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0432\u0438\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0438\u0442\u043e\u0433\u043e\u0432 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 SupserSet<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 ClickHouse \u2014 \u0443 PostgreSQL \u0442\u043e\u0442 \u0436\u0435 \u043f\u0440\u0438\u0451\u043c \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/p>\n<p><strong>\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d-\u0424\u043e\u0440\u043c\u0430\u0442<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d  \/*\u043f\u043e\u0434\u044b\u0442\u043e\u0433*\/<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u0442\u0430  \/*\u0418\u0442\u043e\u0433*\/<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u0434\u0430\u043b\u0435\u0435 &#171;\u0441\u0445\u043b\u043e\u043f\u044b\u0432\u0430\u0435\u043c&#187; \u0447\u0435\u0440\u0435\u0437 UNION <\/p>\n<p><em>\u0412\u0438\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/em><\/p>\n<pre><code class=\"pgsql\">\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043e \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d- \u0424\u043e\u0440\u043c\u0430\u0442*\/SELECT DAY_ID  AS PERIOD,REGION,FORMAT AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c  \u0441\u043b\u043e\u0432\u043e \u00ab\u0418\u0442\u043e\u0433\u00bb *\/UNION ALLSELECT DAY_ID ASPERIOD,REGION,'\u0418\u0442\u043e\u0433' AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0441\u0442\u043e), \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb *\/UNION ALLSELECT DAY_ID AS PERIOD,'\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438' AS REGION, '' AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<p><strong>\u041d\u044e\u0430\u043d\u0441\u044b<\/strong>. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433\u00bb \u0432 Select-\u0435, \u00a0\u0442\u043e \u043f\u043e\u043b\u0435 \u0438\u043c\u0435\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 String, \u0438 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442\u0435 \u0438\u043c\u0435\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 Int, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u043e \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c toString(MyColumn)<\/p>\n<p>\u0421\u0442\u0440\u043e\u0438\u043c \u0441\u0432\u043e\u0434\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb9\/442\/d04\/cb9442d041b4daa386672e010227ea6e.png\" width=\"305\" height=\"385\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/cb9\/442\/d04\/cb9442d041b4daa386672e010227ea6e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb9\/442\/d04\/cb9442d041b4daa386672e010227ea6e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7a8\/3b4\/e06\/7a83b4e0686d35f8e68ad77792d69b9a.png\" alt=\"\u0421\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 UNION\" title=\"\u0421\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 UNION\" width=\"631\" height=\"248\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/7a8\/3b4\/e06\/7a83b4e0686d35f8e68ad77792d69b9a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7a8\/3b4\/e06\/7a83b4e0686d35f8e68ad77792d69b9a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0421\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 UNION<\/figcaption><\/div>\n<\/figure>\n<p>\u0418\u0442\u043e\u0433\u0438 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043d\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434: &#171;\u0418\u0442\u043e\u0433&#187; \u043c\u0435\u0436\u0434\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438, \u0430 &#171;\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#187; \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0441\u044f \u043f\u043e\u0434 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u043a\u0440\u0443\u0433\u043e\u0432.<\/p>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u00ab\u041d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u00bb. \u042d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u0435\u043b, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0438\u043c\u0432\u043e\u043b. \u00a0\u041c\u043e\u0436\u043d\u043e \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a \u0432\u0432\u0435\u0441\u0442\u0438 Invisible symbol, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 \u0438 \u0442\u0430\u043c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b.<\/p>\n<p><em>\u0412\u0438\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u00ab\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u00bb \u0432\u00a0 &#8216;\u200e \u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#8217; \u0438 &#8216;\u200e \u0418\u0442\u043e\u0433&#8217;     <\/em><\/p>\n<pre><code class=\"pgsql\">\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043e \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d- \u0424\u043e\u0440\u043c\u0430\u0442*\/SELECT DAY_ID AS PERIOD,REGION,FORMAT AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c  \u0441\u043b\u043e\u0432\u043e \u00ab\u0418\u0442\u043e\u0433\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b *\/UNION ALLSELECT DAY_ID ASPERIOD,REGION,'\u3164\u0418\u0442\u043e\u0433' AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0441\u0442\u043e), \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b*\/UNION ALLSELECT DAY_ID AS PERIOD,'\u3164\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438' AS REGION, '' AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041d\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f &#171;\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430&#187;<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/90f\/19d\/771\/90f19d7710f8eaa4a767be1ff9f31e84.png\" width=\"624\" height=\"242\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/90f\/19d\/771\/90f19d7710f8eaa4a767be1ff9f31e84.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/90f\/19d\/771\/90f19d7710f8eaa4a767be1ff9f31e84.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438 \u0418\u0442\u043e\u0433 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e: &#171;\u0418\u0442\u043e\u0433&#187; \u0441\u043d\u0438\u0437\u0443 \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438, \u0430 &#171;\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#187; \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u0434 \u0432\u0441\u0435\u043c\u0438 \u043e\u043a\u0440\u0443\u0433\u0430\u043c\u0438.  <\/p>\n<p>\u041d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0438\u0442\u043e\u0433 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0432\u0435\u0440\u0445\u0443, \u0447\u0442\u043e\u0431\u044b \u00a0\u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u0432\u0438\u0434\u0435\u0442\u044c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb, \u0430 \u043d\u0435 \u043f\u0440\u043e\u043b\u0438\u0441\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u043d\u0438\u0437.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0449\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CSS.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0442\u043e\u0433\u0438 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u0432 &#8216;\u200e \u200e\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#8217; \u0438 &#8216;\u200e \u0418\u0442\u043e\u0433&#8217; \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c <strong>\u043e\u0434\u0438\u043d<\/strong> \u00ab\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u00bb, \u0430 \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043e\u043a\u0440\u0443\u0433\u0430 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c <strong>\u0434\u0432\u0430<\/strong> \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. <\/p>\n<p><em>\u0417\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434 <\/em><\/p>\n<pre><code class=\"pgsql\">\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043e \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d- \u0424\u043e\u0440\u043c\u0430\u0442\u043a \u0440\u0435\u0433\u0438\u043e\u043d\u0443 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 CONCAT \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 *\/SELECT DAY_ID AS PERIOD,CONCAT('\u3164\u3164',REGION) AS REGION,CONCAT('\u3164\u3164',FORMAT) AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u043e \u00ab\u0418\u0442\u043e\u0433\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, \u043a \u0440\u0435\u0433\u0438\u043e\u043d\u0443 \u0447\u0435\u0440\u0435\u0437 CONCAT \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 *\/UNION ALLSELECT DAY_ID ASPERIOD,CONCAT('\u3164\u3164',REGION) AS REGION,'\u3164\u0418\u0442\u043e\u0433' AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0441\u0442\u043e), \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b*\/UNION ALLSELECT DAY_ID AS PERIOD,'\u3164\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438' AS REGION, '' AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() - 1GROUP BY 1,2,3<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><em>\u0412\u0438\u0434 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:<\/em><\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd2\/47d\/d64\/bd247dd6474adda7ab5f7ce16a623012.png\" alt=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" title=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\" width=\"624\" height=\"253\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/bd2\/47d\/d64\/bd247dd6474adda7ab5f7ce16a623012.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd2\/47d\/d64\/bd247dd6474adda7ab5f7ce16a623012.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0435\u0449\u0435 \u0438 \u043a\u043e\u0434 CSS, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044e \u0435\u0433\u043e \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"css\">.pivot_table_v_2 table.pvtTable { width:55% !important; font-size: 12px !important; background-color:  white;} \/*\u0437\u0430\u0434\u0430\u0435\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b*\/.pvtTable {  border: 2px solid lightgrey;   border-radius: 5px;} \/*\u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0432\u0441\u0435\u0439 \u0441\u0432\u043e\u0434\u043d\u043e\u0439*\/ .pivot_table_v_2 table.pvtTable tr th.pvtAxisLabel{   font-size: 0px;  border-color: white;  width: 0%;  padding: 0px !important;} \/*\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0441\u043b\u043e\u0432\u043e metric \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443*\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(3) th.pvtAxisLabel {   font-size: 13px;  font-weight: 700;  text-align: center;  padding: 1px 8px !important;} \/*\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c*\/.pivot_table_v_2 table.pvtTable thead tr th.pvtTotalLabel {  border: 0px solid white;  padding: 0px !important;} \/*\u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0443 \u043b\u0435\u0432\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445*\/.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(1) th.pvtColLabel {  color: black;  text-align: center;  font-size: 13px;  font-weight: 600;  padding: 1px 8px !important;  border-left: 1px solid lightgrey; } \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c 1 \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432 \u0441\u0432\u043e\u0434\u043d\u043e\u0439*\/.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(2) th.pvtColLabel {  color: black;  background-color: #dbdbdb; \/*\u0441\u0432\u0435\u0442\u043b\u043e-\u0441\u0435\u0440\u0430\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0430*\/  text-align: center;  font-size: 13px;  font-weight: 600;  padding: 1px 8px !important;  text-wrap: nowrap!important; } \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c 2 \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432 \u0441\u0432\u043e\u0434\u043d\u043e\u0439*\/.pivot_table_v_2 table.pvtTable tr td.pvtVal {  text-wrap: nowrap!important;   text-align: center;  padding: 1px 8px;  vertical-align: middle;  color: black; } \/*\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0432\u043e\u0434\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446*\/.pivot_table_v_2 table.pvtTable tr th.pvtRowLabel {  text-wrap: nowrap!important;   padding: 1px 8px;  font-size: 13px;  vertical-align: middle !important;} \/*\u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 \u0441\u0442\u0440\u043e\u043a \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0442\u0435\u043a\u0441\u0442\u0430*\/\/**** \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438*******\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(1) .pvtVal,.pivot_table_v_2 table.pvtTable tr:nth-of-type(1) th.pvtRowLabel {  border-top: 2px solid #a73333;} \/*\u043f\u043e\u043b\u043e\u0441\u0430 \u043f\u043e\u0434 \u0448\u0430\u043f\u043a\u043e\u0439*\/.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(n) th:nth-of-type(2).pvtColLabel,.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(1) th:nth-of-type(3).pvtColLabel,.pivot_table_v_2 table.pvtTable td:nth-of-type(1).pvtVal,.pivot_table_v_2 table.pvtTable tbody tr.pvtRowTotals td:nth-of-type(1){  border-left: 2px solid #a73333;} \/*\u043f\u043e\u043b\u043e\u0441\u0430 \u043e\u0442\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439*\/.pivot_table_v_2 table.pvtTable th.pvtRowLabel[rowspan]:not([rowspan=\"1\"]) {     border-top: 2px solid #a73333 !important;    font-weight: 600;} \/*\u0433\u0440\u0430\u043d\u0438\u0446\u0430  \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430*\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(-n+1) th:nth-of-type(-n+2).pvtRowLabel,.pivot_table_v_2 table.pvtTable tr:nth-of-type(-n+1) td.pvtVal{   background: #FBEEEC; \/*\u0440\u043e\u0437\u043e\u0432\u0430\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0430*\/  font-weight: 600;} \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043b\u0438\u043d\u0438\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u0442\u043e\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438*\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(n+2) th[rowspan=\"1\"]:nth-of-type(2).pvtRowLabel,.pivot_table_v_2 table.pvtTable tr:nth-of-type(n+2):has(th[rowspan=\"1\"]:nth-of-type(2).pvtRowLabel) .pvtVal{   background: #f5f5f5; \/*\u0441\u0432\u0435\u0442\u043b\u043e-\u0441\u0435\u0440\u0430\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0430*\/  font-weight: 600;  border-top: 2px solid #a73333 !important;  border-bottom: 2px solid #a73333 !important;  vertical-align: middle;} \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043b\u0438\u043d\u0438\u0435\u0439 \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438*\/<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>: \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, SuperSet \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u043f\u0440\u043e\u0441\u0442, \u0438 \u0432 \u043d\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0441\u043c\u0435\u043b\u044b\u0435 \u0438\u0434\u0435\u0438.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1088856\/\">https:\/\/habr.com\/ru\/articles\/1088856\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Superset \u0443\u043c\u0435\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0432\u043e\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b,\u00a0 \u043d\u043e \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u043e\u0432 \u0438 \u0438\u0442\u043e\u0433\u043e\u0432 (subtotals\/total) \u00a0\u0432 \u0441\u0432\u043e\u0434\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0441 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439  \u043c\u0435\u0442\u0440\u0438\u043a\u043e\u0439   \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0448\u044c\u0441\u044f \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c: \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u0410 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0430\u043c\u0438 \u0438 \u0438\u0442\u043e\u0433\u0430\u043c\u0438 \u2014 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.\u00a0\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0411\u0414 (ClickHouse).\u042f \u00a0\u043d\u0430\u0448\u043b\u0430 \u0434\u0432\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0430: UNION \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u0418 \u043d\u0430\u0447\u043d\u0443 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 UNION.\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u041f\u043e\u0442\u0435\u0440\u0438, %\u041f\u043e\u0442\u0435\u0440\u0438, % = \u041f\u043e\u0442\u0435\u0440\u0438, \u0448\u0442\/\u041f\u0440\u043e\u0434\u0430\u0436\u0438, \u0448\u0442\u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u0442\u043e\u0433\u0438 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c SuperSet,\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 SuperSet\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u0412 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0430\u0445\/\u0438\u0442\u043e\u0433\u0430\u0445 \u0441\u043b\u043e\u0436\u0430\u0442\u0441\u044f \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c, \u0447\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c. \u0432\u0438\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0438\u0442\u043e\u0433\u043e\u0432 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 SupserSet\u041a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 ClickHouse \u2014 \u0443 PostgreSQL \u0442\u043e\u0442 \u0436\u0435 \u043f\u0440\u0438\u0451\u043c \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c\u0421\u0447\u0438\u0442\u0430\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f:\u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d-\u0424\u043e\u0440\u043c\u0430\u0442\u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d  \/*\u043f\u043e\u0434\u044b\u0442\u043e\u0433*\/\u0414\u0430\u0442\u0430  \/*\u0418\u0442\u043e\u0433*\/\u0418 \u0434\u0430\u043b\u0435\u0435 &#171;\u0441\u0445\u043b\u043e\u043f\u044b\u0432\u0430\u0435\u043c&#187; \u0447\u0435\u0440\u0435\u0437 UNION \u0412\u0438\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043e \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d- \u0424\u043e\u0440\u043c\u0430\u0442*\/SELECT DAY_ID  AS PERIOD,REGION,FORMAT AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c  \u0441\u043b\u043e\u0432\u043e \u00ab\u0418\u0442\u043e\u0433\u00bb *\/UNION ALLSELECT DAY_ID ASPERIOD,REGION,&#8217;\u0418\u0442\u043e\u0433&#8217; AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0441\u0442\u043e), \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb *\/UNION ALLSELECT DAY_ID AS PERIOD,&#8217;\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#8217; AS REGION, &#187; AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\u041d\u044e\u0430\u043d\u0441\u044b. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433\u00bb \u0432 Select-\u0435, \u00a0\u0442\u043e \u043f\u043e\u043b\u0435 \u0438\u043c\u0435\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 String, \u0438 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442\u0435 \u0438\u043c\u0435\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 Int, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u043e \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c toString(MyColumn)\u0421\u0442\u0440\u043e\u0438\u043c \u0441\u0432\u043e\u0434\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:\u0421\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 UNION\u0418\u0442\u043e\u0433\u0438 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043d\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434: &#171;\u0418\u0442\u043e\u0433&#187; \u043c\u0435\u0436\u0434\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438, \u0430 &#171;\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#187; \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0441\u044f \u043f\u043e\u0434 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u043a\u0440\u0443\u0433\u043e\u0432.\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u00ab\u041d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u00bb. \u042d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u0435\u043b, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0438\u043c\u0432\u043e\u043b. \u00a0\u041c\u043e\u0436\u043d\u043e \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a \u0432\u0432\u0435\u0441\u0442\u0438 Invisible symbol, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 \u0438 \u0442\u0430\u043c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b.\u0412\u0438\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u00ab\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u00bb \u0432\u00a0 &#8216;\u200e \u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#8217; \u0438 &#8216;\u200e \u0418\u0442\u043e\u0433&#8217;     \/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043e \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d- \u0424\u043e\u0440\u043c\u0430\u0442*\/SELECT DAY_ID AS PERIOD,REGION,FORMAT AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c  \u0441\u043b\u043e\u0432\u043e \u00ab\u0418\u0442\u043e\u0433\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b *\/UNION ALLSELECT DAY_ID ASPERIOD,REGION,&#8217;\u3164\u0418\u0442\u043e\u0433&#8217; AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0441\u0442\u043e), \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b*\/UNION ALLSELECT DAY_ID AS PERIOD,&#8217;\u3164\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#8217; AS REGION, &#187; AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\u041d\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f &#171;\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430&#187;\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438 \u0418\u0442\u043e\u0433 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e: &#171;\u0418\u0442\u043e\u0433&#187; \u0441\u043d\u0438\u0437\u0443 \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438, \u0430 &#171;\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#187; \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u0434 \u0432\u0441\u0435\u043c\u0438 \u043e\u043a\u0440\u0443\u0433\u0430\u043c\u0438.  \u041d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0438\u0442\u043e\u0433 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0432\u0435\u0440\u0445\u0443, \u0447\u0442\u043e\u0431\u044b \u00a0\u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u0432\u0438\u0434\u0435\u0442\u044c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb, \u0430 \u043d\u0435 \u043f\u0440\u043e\u043b\u0438\u0441\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u043d\u0438\u0437.\u0422\u0430\u043a\u0436\u0435 \u0442\u0430\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0449\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CSS.\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0442\u043e\u0433\u0438 \u0438 \u043f\u043e\u0434\u044b\u0442\u043e\u0433\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u0432 &#8216;\u200e \u200e\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#8217; \u0438 &#8216;\u200e \u0418\u0442\u043e\u0433&#8217; \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0434\u0438\u043d \u00ab\u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u00bb, \u0430 \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043e\u043a\u0440\u0443\u0433\u0430 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0434\u0432\u0430 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0417\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434 \/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u043e \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d- \u0424\u043e\u0440\u043c\u0430\u0442\u043a \u0440\u0435\u0433\u0438\u043e\u043d\u0443 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 CONCAT \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 *\/SELECT DAY_ID AS PERIOD,CONCAT(&#8216;\u3164\u3164&#8217;,REGION) AS REGION,CONCAT(&#8216;\u3164\u3164&#8217;,FORMAT) AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u0414\u0430\u0442\u0430-\u0420\u0435\u0433\u0438\u043e\u043d, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u043e \u00ab\u0418\u0442\u043e\u0433\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, \u043a \u0440\u0435\u0433\u0438\u043e\u043d\u0443 \u0447\u0435\u0440\u0435\u0437 CONCAT \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u044f \u043f\u0443\u0441\u0442\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 *\/UNION ALLSELECT DAY_ID ASPERIOD,CONCAT(&#8216;\u3164\u3164&#8217;,REGION) AS REGION,&#8217;\u3164\u0418\u0442\u043e\u0433&#8217; AS FRMT,Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\/*\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (\u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0441\u0442\u043e), \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u00ab\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb \u0432\u043f\u0435\u0440\u0435\u0434\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b*\/UNION ALLSELECT DAY_ID AS PERIOD,&#8217;\u3164\u0418\u0442\u043e\u0433 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438&#8217; AS REGION, &#187; AS FRMT, Sum(LOST) AS LOST,  Sum(SALE) AS SALEFROM temp.my_tableWHERE DAY_ID BETWEEN CURDATE()-7 AND CURDATE() &#8212; 1GROUP BY 1,2,3\u0412\u0438\u0434 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0435\u0449\u0435 \u0438 \u043a\u043e\u0434 CSS, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044e \u0435\u0433\u043e \u043d\u0438\u0436\u0435:.pivot_table_v_2 table.pvtTable { width:55% !important; font-size: 12px !important; background-color:  white;} \/*\u0437\u0430\u0434\u0430\u0435\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b*\/.pvtTable {  border: 2px solid lightgrey;   border-radius: 5px;} \/*\u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0432\u0441\u0435\u0439 \u0441\u0432\u043e\u0434\u043d\u043e\u0439*\/ .pivot_table_v_2 table.pvtTable tr th.pvtAxisLabel{   font-size: 0px;  border-color: white;  width: 0%;  padding: 0px !important;} \/*\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0441\u043b\u043e\u0432\u043e metric \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443*\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(3) th.pvtAxisLabel {   font-size: 13px;  font-weight: 700;  text-align: center;  padding: 1px 8px !important;} \/*\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c*\/.pivot_table_v_2 table.pvtTable thead tr th.pvtTotalLabel {  border: 0px solid white;  padding: 0px !important;} \/*\u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0443 \u043b\u0435\u0432\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445*\/.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(1) th.pvtColLabel {  color: black;  text-align: center;  font-size: 13px;  font-weight: 600;  padding: 1px 8px !important;  border-left: 1px solid lightgrey; } \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c 1 \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432 \u0441\u0432\u043e\u0434\u043d\u043e\u0439*\/.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(2) th.pvtColLabel {  color: black;  background-color: #dbdbdb; \/*\u0441\u0432\u0435\u0442\u043b\u043e-\u0441\u0435\u0440\u0430\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0430*\/  text-align: center;  font-size: 13px;  font-weight: 600;  padding: 1px 8px !important;  text-wrap: nowrap!important; } \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c 2 \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432 \u0441\u0432\u043e\u0434\u043d\u043e\u0439*\/.pivot_table_v_2 table.pvtTable tr td.pvtVal {  text-wrap: nowrap!important;   text-align: center;  padding: 1px 8px;  vertical-align: middle;  color: black; } \/*\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0432\u043e\u0434\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446*\/.pivot_table_v_2 table.pvtTable tr th.pvtRowLabel {  text-wrap: nowrap!important;   padding: 1px 8px;  font-size: 13px;  vertical-align: middle !important;} \/*\u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445 \u0441\u0442\u0440\u043e\u043a \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0442\u0435\u043a\u0441\u0442\u0430*\/\/**** \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438*******\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(1) .pvtVal,.pivot_table_v_2 table.pvtTable tr:nth-of-type(1) th.pvtRowLabel {  border-top: 2px solid #a73333;} \/*\u043f\u043e\u043b\u043e\u0441\u0430 \u043f\u043e\u0434 \u0448\u0430\u043f\u043a\u043e\u0439*\/.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(n) th:nth-of-type(2).pvtColLabel,.pivot_table_v_2 table.pvtTable thead tr:nth-of-type(1) th:nth-of-type(3).pvtColLabel,.pivot_table_v_2 table.pvtTable td:nth-of-type(1).pvtVal,.pivot_table_v_2 table.pvtTable tbody tr.pvtRowTotals td:nth-of-type(1){  border-left: 2px solid #a73333;} \/*\u043f\u043e\u043b\u043e\u0441\u0430 \u043e\u0442\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439*\/.pivot_table_v_2 table.pvtTable th.pvtRowLabel[rowspan]:not([rowspan=&#187;1&#8243;]) {     border-top: 2px solid #a73333 !important;    font-weight: 600;} \/*\u0433\u0440\u0430\u043d\u0438\u0446\u0430  \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430*\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(-n+1) th:nth-of-type(-n+2).pvtRowLabel,.pivot_table_v_2 table.pvtTable tr:nth-of-type(-n+1) td.pvtVal{   background: #FBEEEC; \/*\u0440\u043e\u0437\u043e\u0432\u0430\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0430*\/  font-weight: 600;} \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043b\u0438\u043d\u0438\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u0442\u043e\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438*\/.pivot_table_v_2 table.pvtTable tr:nth-of-type(n+2) th[rowspan=&#187;1&#8243;]:nth-of-type(2).pvtRowLabel,.pivot_table_v_2 table.pvtTable tr:nth-of-type(n+2):has(th[rowspan=&#187;1&#8243;]:nth-of-type(2).pvtRowLabel) .pvtVal{   background: #f5f5f5; \/*\u0441\u0432\u0435\u0442\u043b\u043e-\u0441\u0435\u0440\u0430\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0430*\/  font-weight: 600;  border-top: 2px solid #a73333 !important;  border-bottom: 2px solid #a73333 !important;  vertical-align: middle;} \/*\u043f\u043e\u0434\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043b\u0438\u043d\u0438\u0435\u0439 \u043f\u043e\u0434\u044b\u0442\u043e\u0433 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438*\/\u0412\u044b\u0432\u043e\u0434: \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, SuperSet \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u043f\u0440\u043e\u0441\u0442, \u0438 \u0432 \u043d\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0441\u043c\u0435\u043b\u044b\u0435 \u0438\u0434\u0435\u0438.\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1088856\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-496823","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/496823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=496823"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/496823\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=496823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=496823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=496823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}