{"id":306,"date":"2017-03-05T18:25:50","date_gmt":"2017-03-05T11:25:50","guid":{"rendered":"http:\/\/www.oopsbox.com\/?p=306"},"modified":"2017-03-05T22:13:35","modified_gmt":"2017-03-05T15:13:35","slug":"%e0%b9%84%e0%b8%95%e0%b8%a3%e0%b8%a1%e0%b8%b2%e0%b8%aa%e0%b9%83%e0%b8%99-mysql","status":"publish","type":"post","link":"https:\/\/www.oopsbox.com\/?p=306","title":{"rendered":"\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e43\u0e19 MySQL \u0e41\u0e1a\u0e1a\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e02\u0e2d\u0e07\u0e44\u0e17\u0e22"},"content":{"rendered":"<p><strong>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a<\/strong> \u0e40\u0e1b\u0e47\u0e19\u0e0a\u0e48\u0e27\u0e07\u0e23\u0e30\u0e22\u0e30\u0e40\u0e27\u0e25\u0e32\u0e2a\u0e32\u0e21\u0e40\u0e14\u0e37\u0e2d\u0e19 \u0e0b\u0e36\u0e48\u0e07\u0e41\u0e1a\u0e48\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32 \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e1b\u0e35 \u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19 \u0e2a\u0e35\u0e48 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a \u0e43\u0e19\u0e40\u0e0a\u0e34\u0e07\u0e18\u0e38\u0e23\u0e01\u0e34\u0e08\u0e01\u0e32\u0e23\u0e1e\u0e34\u0e08\u0e32\u0e23\u0e13\u0e32\u0e1c\u0e25\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e01\u0e32\u0e23\u0e19\u0e34\u0e22\u0e21\u0e43\u0e0a\u0e49\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a \u0e43\u0e19\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e30\u0e40\u0e21\u0e34\u0e19\u0e1c\u0e25 \u0e01\u0e23\u0e13\u0e35\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e15\u0e32\u0e21\u0e1b\u0e35\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e44\u0e14\u0e49<\/p>\n<ul>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 1 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21<\/li>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 2 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19\u0e16\u0e36\u0e07\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19<\/li>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 3 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19<\/li>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 4 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21<\/li>\n<\/ul>\n<p>\u0e41\u0e15\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e23\u0e32\u0e0a\u0e01\u0e32\u0e23\u0e02\u0e2d\u0e07\u0e44\u0e17\u0e22 \u0e23\u0e30\u0e1a\u0e1a\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e43\u0e2b\u0e0d\u0e48\u0e02\u0e36\u0e49\u0e19\u0e01\u0e31\u0e1a\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13 ^_^<\/p>\n<blockquote><p><strong>\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13<\/strong> \u0e2b\u0e23\u0e37\u0e2d <strong>\u0e1b\u0e35\u0e07\u0e1a\u0e01\u0e32\u0e23\u0e40\u0e07\u0e34\u0e19<\/strong> (\u0e2d\u0e31\u0e07\u0e01\u0e24\u0e29: fiscal year, financial year \u0e2b\u0e23\u0e37\u0e2d budget year) \u0e40\u0e1b\u0e47\u0e19\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e04\u0e33\u0e19\u0e27\u0e13\u0e07\u0e1a\u0e01\u0e32\u0e23\u0e40\u0e07\u0e34\u0e19\u0e1b\u0e23\u0e30\u0e08\u0e33\u0e1b\u0e35\u0e43\u0e19\u0e18\u0e38\u0e23\u0e01\u0e34\u0e08\u0e41\u0e25\u0e30\u0e2d\u0e07\u0e04\u0e4c\u0e01\u0e23\u0e2d\u0e37\u0e48\u0e19 \u0e46 \u0e43\u0e19\u0e2b\u0e25\u0e32\u0e22\u0e40\u0e02\u0e15\u0e2d\u0e33\u0e19\u0e32\u0e08\u0e15\u0e32\u0e21\u0e01\u0e0e\u0e2b\u0e21\u0e32\u0e22 \u0e01\u0e0e\u0e02\u0e49\u0e2d\u0e1a\u0e31\u0e07\u0e04\u0e31\u0e1a\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e0d\u0e0a\u0e35\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e40\u0e01\u0e47\u0e1a\u0e20\u0e32\u0e29\u0e35 \u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e2d\u0e32\u0e28\u0e31\u0e22\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e40\u0e2b\u0e25\u0e48\u0e32\u0e19\u0e35\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e49\u0e2d\u0e22\u0e04\u0e23\u0e31\u0e49\u0e07\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e15\u0e48\u0e2d\u0e2a\u0e34\u0e1a\u0e2a\u0e2d\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19 \u0e41\u0e15\u0e48\u0e44\u0e21\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\u0e27\u0e48\u0e32\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e15\u0e23\u0e07\u0e01\u0e31\u0e1a\u0e1b\u0e35\u0e15\u0e32\u0e21\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19 \u0e0b\u0e36\u0e07\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e02\u0e2d\u0e07\u0e44\u0e17\u0e22\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19\u0e02\u0e2d\u0e07\u0e1b\u0e35\u0e16\u0e31\u0e14\u0e44\u0e1b<\/p><\/blockquote>\n<p>\u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e23\u0e30\u0e1a\u0e1a\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e08\u0e36\u0e07\u0e41\u0e1a\u0e48\u0e07\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19<\/p>\n<ul>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 1 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21<\/li>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 2 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21<\/li>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 3 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19\u0e16\u0e36\u0e07\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19<\/li>\n<li>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 4 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19<\/li>\n<\/ul>\n<p>\u0e0b\u0e36\u0e48\u0e07\u0e43\u0e19 MySQL \u0e40\u0e2d\u0e07\u0e01\u0e47\u0e21\u0e35\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e48\u0e19\u0e17\u0e35\u0e48\u0e04\u0e33\u0e19\u0e27\u0e13\u0e2b\u0e32\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e0a\u0e37\u0e48\u0e2d QUARTER \u0e2d\u0e22\u0e39\u0e48\u0e41\u0e25\u0e49\u0e27\u0e0b\u0e36\u0e48\u0e07\u0e2d\u0e34\u0e07\u0e08\u0e32\u0e01\u0e1b\u0e35\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19<\/p>\n<p>QUARTER(date) : Returns the quarter of the year for date, in the range 1 to 4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">mysql&gt; SELECT QUARTER('2016-10-18');\r\n+-----------------------+\r\n| QUARTER('2016-10-18') |\r\n+-----------------------+\r\n|                     4 | \r\n+-----------------------+\r\n<\/pre>\n<p>\u0e1c\u0e25\u0e2d\u0e34\u0e07\u0e08\u0e32\u0e01\u0e1b\u0e35\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19\u0e01\u0e47\u0e15\u0e32\u0e21\u0e19\u0e31\u0e49\u0e19 ^_^ \u0e2d\u0e49\u0e32\u0e27\u0e27 \u0e07\u0e31\u0e49\u0e19\u0e40\u0e23\u0e32\u0e21\u0e32\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e48\u0e19\u0e2b\u0e32\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e08\u0e32\u0e01\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e01\u0e31\u0e19<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">CREATE DEFINER=`root`@`localhost` FUNCTION `THQUARTER`(\r\n    xdate DATETIME,\r\n    th BIT) RETURNS int(11)\r\nDETERMINISTIC\r\nBEGIN\r\n    DECLARE qt INT;\r\n    \r\n    SET qt = QUARTER(xdate) + th;\r\n    \r\n    RETURN IF(qt &gt; 4, qt - 4, qt);\r\nEND\r\n\r\n-- Test\r\nmysql&gt;\u00a0SELECT THQUARTER('2016-10-18');\r\n+-----------------------+\r\n| THQUARTER('2016-10-18')\u00a0|\r\n+-----------------------+\r\n|\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 |\u00a0\r\n+-----------------------+<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0e21\u0e32\u0e25\u0e2d\u0e07\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e01\u0e31\u0e19 \u0e2a\u0e21\u0e21\u0e38\u0e15\u0e34\u0e42\u0e08\u0e17\u0e22\u0e4c\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2b\u0e32<strong>\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e01\u0e32\u0e23\u0e23\u0e31\u0e1a\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23\u0e02\u0e2d\u0e07\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22\u0e43\u0e19\u0e2a\u0e16\u0e32\u0e19\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23\u0e41\u0e22\u0e01\u0e23\u0e32\u0e22\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a (\u0e04\u0e23\u0e31\u0e49\u0e07)<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">-- Generate dummy data\r\nCREATE TABLE `visit` (\r\n  `visitno` mediumint(8) unsigned NOT NULL auto_increment,\r\n  `visitdate` varchar(255),\r\n  `pid` varchar(255) default NULL,\r\n  `pcucode` varchar(255) default NULL,\r\n  PRIMARY KEY (`visitno`)\r\n) AUTO_INCREMENT=1;\r\n\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2017-01-09\",\"5\",\"yellow\"),(\"2017-06-11\",\"9\",\"orange\"),(\"2016-11-28\",\"9\",\"yellow\"),(\"2017-06-02\",\"2\",\"red\"),(\"2017-01-09\",\"10\",\"orange\"),(\"2017-05-03\",\"10\",\"orange\"),(\"2017-07-06\",\"8\",\"red\"),(\"2017-06-25\",\"10\",\"yellow\"),(\"2017-04-19\",\"3\",\"orange\"),(\"2017-06-12\",\"3\",\"yellow\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2016-11-12\",\"10\",\"orange\"),(\"2017-06-18\",\"5\",\"red\"),(\"2017-05-20\",\"9\",\"yellow\"),(\"2017-04-01\",\"2\",\"red\"),(\"2016-12-31\",\"6\",\"red\"),(\"2017-02-05\",\"8\",\"orange\"),(\"2017-02-19\",\"3\",\"red\"),(\"2017-03-13\",\"5\",\"red\"),(\"2017-03-27\",\"3\",\"yellow\"),(\"2017-06-22\",\"8\",\"yellow\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2017-01-17\",\"6\",\"red\"),(\"2016-10-15\",\"5\",\"yellow\"),(\"2017-05-30\",\"8\",\"orange\"),(\"2017-04-29\",\"5\",\"red\"),(\"2017-01-02\",\"3\",\"orange\"),(\"2017-09-04\",\"4\",\"red\"),(\"2017-01-09\",\"3\",\"orange\"),(\"2016-12-15\",\"7\",\"yellow\"),(\"2017-01-31\",\"8\",\"orange\"),(\"2016-11-08\",\"6\",\"yellow\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2017-01-10\",\"5\",\"orange\"),(\"2016-11-20\",\"3\",\"yellow\"),(\"2017-07-09\",\"8\",\"red\"),(\"2017-01-20\",\"8\",\"red\"),(\"2017-05-17\",\"8\",\"red\"),(\"2017-08-05\",\"5\",\"yellow\"),(\"2017-07-19\",\"7\",\"red\"),(\"2017-05-06\",\"10\",\"yellow\"),(\"2017-06-01\",\"6\",\"orange\"),(\"2016-11-06\",\"9\",\"red\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2017-09-20\",\"5\",\"orange\"),(\"2017-01-28\",\"8\",\"yellow\"),(\"2017-02-20\",\"7\",\"red\"),(\"2016-11-24\",\"5\",\"orange\"),(\"2016-12-27\",\"5\",\"orange\"),(\"2017-05-20\",\"6\",\"yellow\"),(\"2017-07-03\",\"1\",\"red\"),(\"2017-09-09\",\"8\",\"yellow\"),(\"2017-06-04\",\"9\",\"red\"),(\"2017-03-04\",\"9\",\"orange\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2017-09-12\",\"6\",\"orange\"),(\"2017-07-24\",\"1\",\"yellow\"),(\"2017-02-27\",\"5\",\"red\"),(\"2017-08-21\",\"3\",\"yellow\"),(\"2017-01-26\",\"2\",\"orange\"),(\"2017-05-08\",\"8\",\"orange\"),(\"2016-12-26\",\"2\",\"red\"),(\"2017-06-24\",\"7\",\"red\"),(\"2017-02-20\",\"6\",\"red\"),(\"2017-04-18\",\"10\",\"yellow\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2017-03-01\",\"6\",\"yellow\"),(\"2017-07-15\",\"1\",\"yellow\"),(\"2016-11-11\",\"4\",\"yellow\"),(\"2017-06-27\",\"10\",\"orange\"),(\"2017-01-02\",\"10\",\"orange\"),(\"2017-05-08\",\"7\",\"orange\"),(\"2017-03-16\",\"2\",\"red\"),(\"2017-02-27\",\"4\",\"orange\"),(\"2017-02-14\",\"4\",\"orange\"),(\"2017-04-23\",\"9\",\"yellow\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2016-12-02\",\"1\",\"orange\"),(\"2017-04-15\",\"9\",\"yellow\"),(\"2017-01-25\",\"6\",\"yellow\"),(\"2017-05-06\",\"7\",\"yellow\"),(\"2017-07-31\",\"8\",\"orange\"),(\"2017-07-23\",\"4\",\"yellow\"),(\"2017-06-02\",\"7\",\"red\"),(\"2017-02-06\",\"7\",\"yellow\"),(\"2017-02-14\",\"6\",\"red\"),(\"2017-07-27\",\"3\",\"yellow\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2016-10-21\",\"1\",\"red\"),(\"2017-01-13\",\"5\",\"red\"),(\"2017-06-06\",\"1\",\"red\"),(\"2017-01-16\",\"7\",\"yellow\"),(\"2017-01-29\",\"9\",\"orange\"),(\"2016-11-06\",\"7\",\"red\"),(\"2017-01-06\",\"2\",\"red\"),(\"2017-01-12\",\"6\",\"yellow\"),(\"2017-06-29\",\"5\",\"red\"),(\"2017-04-04\",\"10\",\"yellow\");\r\nINSERT INTO `visit` (`visitdate`,`pid`,`pcucode`) VALUES (\"2017-03-11\",\"10\",\"red\"),(\"2017-05-22\",\"2\",\"red\"),(\"2017-03-21\",\"2\",\"yellow\"),(\"2017-02-19\",\"3\",\"orange\"),(\"2016-11-30\",\"3\",\"red\"),(\"2017-06-30\",\"2\",\"yellow\"),(\"2017-09-17\",\"2\",\"red\"),(\"2017-04-21\",\"7\",\"orange\"),(\"2017-02-12\",\"1\",\"yellow\"),(\"2017-05-12\",\"7\",\"red\");\r\n<\/pre>\n<p>\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">mysql&gt; SELECT\r\n    -&gt;     pcucode,\r\n    -&gt;     SUM(IF(THQUARTER(visitdate, 1) = 1, 1, 0)) AS Q1,\r\n    -&gt;     SUM(IF(THQUARTER(visitdate, 1) = 2, 1, 0)) AS Q2,\r\n    -&gt;     SUM(IF(THQUARTER(visitdate, 1) = 3, 1, 0)) AS Q3,\r\n    -&gt;     SUM(IF(THQUARTER(visitdate, 1) = 4, 1, 0)) AS Q4,\r\n    -&gt;     COUNT(visitno) AS Total\r\n    -&gt; FROM visit\r\n    -&gt; GROUP BY pcucode\r\n    -&gt; WITH ROLLUP;\r\n+---------+------+------+------+------+-------+\r\n| pcucode | Q1   | Q2   | Q3   | Q4   | Total |\r\n+---------+------+------+------+------+-------+\r\n| orange  |    4 |   13 |    9 |    3 |    29 |\r\n| red     |    6 |   12 |   12 |    6 |    36 |\r\n| yellow  |    6 |   10 |   12 |    7 |    35 |\r\n| NULL    |   16 |   35 |   33 |   16 |   100 |\r\n+---------+------+------+------+------+-------+\r\n4 rows in set (0.02 sec)\r\n<\/pre>\n<p>\u0e1b\u0e31\u0e48\u0e19\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e01\u0e31\u0e19\u0e15\u0e48\u0e2d T_T<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"s-share-buttons\" class=\"\"><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"fb-share-button\" data-href=\"https:\/\/www.oopsbox.com\/?p=306\" data-type=\"button_count\"><\/div><\/div><div class=\"s-single-share\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\"><\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/div><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"g-plusone\" data-size=\"medium\"><\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"\/\/www.pinterest.com\/pin\/create\/button\/\" data-pin-do=\"buttonBookmark\"  data-pin-color=\"red\"><img decoding=\"async\" src=\"\/\/assets.pinterest.com\/images\/pidgets\/pinit_fg_en_rect_red_20.png\" \/><\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<script type=\"text\/javascript\" async defer src=\"\/\/assets.pinterest.com\/js\/pinit.js\"><\/script>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/div><div class=\"s-single-share\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"mailto:?Subject=\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e43\u0e19%20MySQL%20\u0e41\u0e1a\u0e1a\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e02\u0e2d\u0e07\u0e44\u0e17\u0e22&Body=Here%20is%20the%20link%20to%20the%20article:%20https:\/\/www.oopsbox.com\/?p=306\" title=\"Email\" class=\"s3-email\"><img decoding=\"async\" src=\"https:\/\/www.oopsbox.com\/wp-content\/plugins\/simple-social-share\/includes\/..\/images\/share-email.png\"><\/a>\n\t\t\t\t\t\t\t\t\t\t\t<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a \u0e40\u0e1b\u0e47\u0e19\u0e0a\u0e48\u0e27\u0e07\u0e23\u0e30\u0e22\u0e30\u0e40\u0e27\u0e25\u0e32\u0e2a\u0e32\u0e21\u0e40\u0e14\u0e37\u0e2d\u0e19 \u0e0b\u0e36\u0e48\u0e07\u0e41\u0e1a\u0e48\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32 \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e1b\u0e35 \u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19 \u0e2a\u0e35\u0e48 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a \u0e43\u0e19\u0e40\u0e0a\u0e34\u0e07\u0e18\u0e38\u0e23\u0e01\u0e34\u0e08\u0e01\u0e32\u0e23\u0e1e\u0e34\u0e08\u0e32\u0e23\u0e13\u0e32\u0e1c\u0e25\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e01\u0e32\u0e23\u0e19\u0e34\u0e22\u0e21\u0e43\u0e0a\u0e49\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a \u0e43\u0e19\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e30\u0e40\u0e21\u0e34\u0e19\u0e1c\u0e25 \u0e01\u0e23\u0e13\u0e35\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e15\u0e32\u0e21\u0e1b\u0e35\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e44\u0e14\u0e49 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 1 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 2 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19\u0e16\u0e36\u0e07\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 3 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 4 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21 \u0e41\u0e15\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e23\u0e32\u0e0a\u0e01\u0e32\u0e23\u0e02\u0e2d\u0e07\u0e44\u0e17\u0e22 \u0e23\u0e30\u0e1a\u0e1a\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e43\u0e2b\u0e0d\u0e48\u0e02\u0e36\u0e49\u0e19\u0e01\u0e31\u0e1a\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13 ^_^ \u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13 \u0e2b\u0e23\u0e37\u0e2d \u0e1b\u0e35\u0e07\u0e1a\u0e01\u0e32\u0e23\u0e40\u0e07\u0e34\u0e19 (\u0e2d\u0e31\u0e07\u0e01\u0e24\u0e29: fiscal year, financial year \u0e2b\u0e23\u0e37\u0e2d budget year) \u0e40\u0e1b\u0e47\u0e19\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e04\u0e33\u0e19\u0e27\u0e13\u0e07\u0e1a\u0e01\u0e32\u0e23\u0e40\u0e07\u0e34\u0e19\u0e1b\u0e23\u0e30\u0e08\u0e33\u0e1b\u0e35\u0e43\u0e19\u0e18\u0e38\u0e23\u0e01\u0e34\u0e08\u0e41\u0e25\u0e30\u0e2d\u0e07\u0e04\u0e4c\u0e01\u0e23\u0e2d\u0e37\u0e48\u0e19 \u0e46 \u0e43\u0e19\u0e2b\u0e25\u0e32\u0e22\u0e40\u0e02\u0e15\u0e2d\u0e33\u0e19\u0e32\u0e08\u0e15\u0e32\u0e21\u0e01\u0e0e\u0e2b\u0e21\u0e32\u0e22 \u0e01\u0e0e\u0e02\u0e49\u0e2d\u0e1a\u0e31\u0e07\u0e04\u0e31\u0e1a\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e0d\u0e0a\u0e35\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e40\u0e01\u0e47\u0e1a\u0e20\u0e32\u0e29\u0e35 \u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e2d\u0e32\u0e28\u0e31\u0e22\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e40\u0e2b\u0e25\u0e48\u0e32\u0e19\u0e35\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e49\u0e2d\u0e22\u0e04\u0e23\u0e31\u0e49\u0e07\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e15\u0e48\u0e2d\u0e2a\u0e34\u0e1a\u0e2a\u0e2d\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19 \u0e41\u0e15\u0e48\u0e44\u0e21\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\u0e27\u0e48\u0e32\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07\u0e15\u0e23\u0e07\u0e01\u0e31\u0e1a\u0e1b\u0e35\u0e15\u0e32\u0e21\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19 \u0e0b\u0e36\u0e07\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e02\u0e2d\u0e07\u0e44\u0e17\u0e22\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19\u0e02\u0e2d\u0e07\u0e1b\u0e35\u0e16\u0e31\u0e14\u0e44\u0e1b \u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e23\u0e30\u0e1a\u0e1a\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e08\u0e36\u0e07\u0e41\u0e1a\u0e48\u0e07\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 1 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 2 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21\u0e16\u0e36\u0e07\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 3 \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19\u0e16\u0e36\u0e07\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19 \u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e17\u0e35\u0e48 4 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.oopsbox.com\/?p=306\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;\u0e44\u0e15\u0e23\u0e21\u0e32\u0e2a\u0e43\u0e19 MySQL \u0e41\u0e1a\u0e1a\u0e1b\u0e35\u0e07\u0e1a\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e02\u0e2d\u0e07\u0e44\u0e17\u0e22&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":307,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[12,36,35],"class_list":["post-306","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-note","tag-mysql","tag-quarter","tag-35","entry"],"views":28144,"_links":{"self":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306"}],"version-history":[{"count":5,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":313,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions\/313"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/media\/307"}],"wp:attachment":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}