{"id":139,"date":"2015-10-15T02:11:20","date_gmt":"2015-10-14T19:11:20","guid":{"rendered":"http:\/\/www.oopsbox.com\/?p=139"},"modified":"2015-10-16T21:31:29","modified_gmt":"2015-10-16T14:31:29","slug":"mysql-select-the-count-of-values-grouped-by-ranges","status":"publish","type":"post","link":"https:\/\/www.oopsbox.com\/?p=139","title":{"rendered":"MySQL : Select the count of values grouped by ranges"},"content":{"rendered":"<p>\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e40\u0e04\u0e22\u0e40\u0e2b\u0e47\u0e19\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e23\u0e32\u0e1f\u0e17\u0e35\u0e48\u0e19\u0e33\u0e40\u0e2a\u0e19\u0e2d\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e02\u0e2d\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e17\u0e35\u0e48\u0e40\u0e2b\u0e47\u0e19\u0e01\u0e31\u0e19\u0e1a\u0e48\u0e2d\u0e22 \u0e46 \u0e01\u0e47\u0e40\u0e0a\u0e48\u0e19\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e0a\u0e31\u0e14\u0e40\u0e25\u0e22 \u0e44\u0e21\u0e48\u0e04\u0e38\u0e49\u0e19\u0e01\u0e47\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e19\u0e35\u0e49 (\u0e19\u0e35\u0e48\u0e2d\u0e49\u0e32\u0e07\u0e2d\u0e34\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e38\u0e02\u0e20\u0e32\u0e1e\u0e02\u0e2d\u0e07\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14\u0e40\u0e23\u0e32\u0e40\u0e25\u0e22\u0e19\u0e30)<\/p>\n<p><a href=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/GroupByRange_01.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-140\" src=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/GroupByRange_01-1024x401.png\" alt=\"GroupByRange_01\" width=\"1024\" height=\"401\" srcset=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/GroupByRange_01-1024x401.png 1024w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/GroupByRange_01-300x117.png 300w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/GroupByRange_01.png 1292w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e1a\u0e2d\u0e01\u0e2d\u0e30\u0e44\u0e23 \/\/ \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e2a\u0e32\u0e23\u0e30<\/p>\n<blockquote><p>\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23 \u0e41\u0e2a\u0e14\u0e07\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e23\u0e35\u0e22\u0e1a\u0e40\u0e17\u0e35\u0e22\u0e1a\u0e40\u0e2b\u0e47\u0e19\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e17\u0e31\u0e49\u0e07\u0e2a\u0e2d\u0e07\u0e40\u0e1e\u0e28\u0e44\u0e14\u0e49\u0e0a\u0e31\u0e14\u0e40\u0e08\u0e19 \u0e01\u0e23\u0e32\u0e1f\u0e41\u0e17\u0e48\u0e07\u0e41\u0e17\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e2d\u0e07\u0e40\u0e1e\u0e28\u0e0a\u0e32\u0e22\u0e41\u0e25\u0e30\u0e2b\u0e0d\u0e34\u0e07\u0e08\u0e30\u0e27\u0e32\u0e07\u0e04\u0e39\u0e48\u0e01\u0e31\u0e19\u0e44\u0e27\u0e49\u0e14\u0e49\u0e32\u0e19\u0e02\u0e27\u0e32\u0e41\u0e25\u0e30\u0e14\u0e49\u0e32\u0e19\u0e0b\u0e49\u0e32\u0e22\u0e02\u0e2d\u0e07\u0e41\u0e01\u0e19\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14 \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e25\u0e30\u0e2b\u0e21\u0e27\u0e14\u0e2d\u0e32\u0e22\u0e38 \u0e42\u0e14\u0e22\u0e2d\u0e32\u0e22\u0e38\u0e19\u0e49\u0e2d\u0e22\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14\u0e08\u0e30\u0e2d\u0e22\u0e39\u0e48\u0e41\u0e17\u0e48\u0e07\u0e25\u0e48\u0e32\u0e07\u0e2a\u0e38\u0e14 \u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48\u0e2b\u0e21\u0e27\u0e14\u0e2d\u0e32\u0e22\u0e38 0 &#8211; 4 \u0e1b\u0e35, 5 &#8211; 9 \u0e1b\u0e35 \u0e2a\u0e39\u0e07\u0e02\u0e36\u0e49\u0e19\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e22\u0e46 \u0e14\u0e49\u0e32\u0e19\u0e1a\u0e19\u0e2a\u0e38\u0e14\u0e04\u0e37\u0e2d\u0e2b\u0e21\u0e27\u0e14\u0e2d\u0e32\u0e22\u0e38\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e07\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14 \u0e0b\u0e36\u0e48\u0e07\u0e08\u0e30\u0e21\u0e35\u0e08\u0e33\u0e19\u0e27\u0e19\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e19\u0e49\u0e2d\u0e22\u0e01\u0e27\u0e48\u0e32\u0e2b\u0e21\u0e27\u0e14\u0e2d\u0e32\u0e22\u0e38\u0e2d\u0e37\u0e48\u0e19\u0e46 \u0e17\u0e33\u0e43\u0e2b\u0e49\u0e2a\u0e48\u0e27\u0e19\u0e1a\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e22\u0e2d\u0e14\u0e41\u0e2b\u0e25\u0e21 \u0e08\u0e36\u0e07\u0e40\u0e23\u0e35\u0e22\u0e01\u0e27\u0e48\u0e32\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14<br \/>\n\u0e23\u0e39\u0e1b\u0e23\u0e48\u0e32\u0e07\u0e02\u0e2d\u0e07\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e2b\u0e49\u0e40\u0e2b\u0e47\u0e19\u0e16\u0e36\u0e07\u0e1c\u0e25\u0e2a\u0e30\u0e2a\u0e21\u0e02\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e01\u0e34\u0e14 \u0e01\u0e32\u0e23\u0e15\u0e32\u0e22\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e22\u0e49\u0e32\u0e22\u0e16\u0e34\u0e48\u0e19 \u0e40\u0e0a\u0e48\u0e19<\/p>\n<p>-\u0e16\u0e49\u0e32\u0e2d\u0e31\u0e15\u0e23\u0e32\u0e40\u0e01\u0e34\u0e14\u0e22\u0e31\u0e07\u0e04\u0e07\u0e2a\u0e39\u0e07\u0e02\u0e36\u0e49\u0e19 \u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e43\u0e19\u0e27\u0e31\u0e22\u0e40\u0e14\u0e47\u0e01\u0e08\u0e30\u0e21\u0e35\u0e08\u0e33\u0e19\u0e27\u0e19\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e22\u0e46 \u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e08\u0e30\u0e01\u0e27\u0e49\u0e32\u0e07\u0e2d\u0e2d\u0e01 \u0e16\u0e49\u0e32\u0e2d\u0e31\u0e15\u0e23\u0e32\u0e40\u0e01\u0e34\u0e14\u0e01\u0e33\u0e25\u0e31\u0e07\u0e25\u0e14\u0e25\u0e07 \u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e08\u0e30\u0e04\u0e48\u0e2d\u0e22\u0e46 \u0e41\u0e04\u0e1a\u0e40\u0e02\u0e49\u0e32<br \/>\n-\u0e16\u0e49\u0e32\u0e2d\u0e31\u0e15\u0e23\u0e32\u0e15\u0e32\u0e22\u0e25\u0e14\u0e25\u0e07 \u0e2d\u0e31\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e1c\u0e25\u0e21\u0e32\u0e08\u0e32\u0e01\u0e04\u0e27\u0e32\u0e21\u0e01\u0e49\u0e32\u0e27\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e32\u0e07\u0e01\u0e32\u0e23\u0e41\u0e1e\u0e17\u0e22\u0e4c\u0e41\u0e25\u0e30\u0e2a\u0e38\u0e02\u0e2d\u0e19\u0e32\u0e21\u0e31\u0e22\u0e17\u0e35\u0e48\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e04\u0e19\u0e2d\u0e32\u0e22\u0e38\u0e22\u0e37\u0e19\u0e02\u0e36\u0e49\u0e19 \u0e22\u0e2d\u0e14\u0e02\u0e2d\u0e07\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e0b\u0e36\u0e48\u0e07\u0e41\u0e2a\u0e14\u0e07\u0e16\u0e36\u0e07\u0e08\u0e33\u0e19\u0e27\u0e19\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e27\u0e31\u0e22\u0e2a\u0e39\u0e07\u0e2d\u0e32\u0e22\u0e38\u0e01\u0e47\u0e08\u0e30\u0e04\u0e48\u0e2d\u0e22\u0e46 \u0e01\u0e27\u0e49\u0e32\u0e07\u0e2d\u0e2d\u0e01<br \/>\n-\u0e01\u0e32\u0e23\u0e15\u0e32\u0e22\u0e43\u0e19\u0e2a\u0e07\u0e04\u0e23\u0e32\u0e21\u0e2b\u0e23\u0e37\u0e2d\u0e2d\u0e38\u0e1a\u0e31\u0e15\u0e34\u0e40\u0e2b\u0e15\u0e38\u0e17\u0e35\u0e48\u0e40\u0e01\u0e34\u0e14\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e0a\u0e35\u0e27\u0e34\u0e15\u0e42\u0e25\u0e14\u0e42\u0e1c\u0e19\u0e43\u0e19\u0e2b\u0e21\u0e39\u0e48\u0e27\u0e31\u0e22\u0e23\u0e38\u0e48\u0e19\u0e0a\u0e32\u0e22 \u0e2d\u0e32\u0e08\u0e17\u0e33\u0e43\u0e2b\u0e49\u0e08\u0e33\u0e19\u0e27\u0e19\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e0a\u0e32\u0e22\u0e19\u0e49\u0e2d\u0e22\u0e01\u0e27\u0e48\u0e32\u0e2b\u0e0d\u0e34\u0e07\u0e43\u0e19\u0e2b\u0e21\u0e27\u0e14\u0e2d\u0e32\u0e22\u0e38\u0e40\u0e14\u0e35\u0e22\u0e27\u0e01\u0e31\u0e19 \u0e0b\u0e36\u0e48\u0e07\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e2b\u0e49\u0e40\u0e2b\u0e47\u0e19\u0e08\u0e32\u0e01\u0e41\u0e17\u0e48\u0e07\u0e01\u0e23\u0e32\u0e1f\u0e14\u0e49\u0e32\u0e19\u0e0b\u0e49\u0e32\u0e22\u0e08\u0e30\u0e2a\u0e31\u0e49\u0e19\u0e01\u0e27\u0e48\u0e32\u0e14\u0e49\u0e32\u0e19\u0e02\u0e27\u0e32<\/p><\/blockquote>\n<p>\u0e04\u0e23\u0e48\u0e32\u0e27 \u0e46 \u0e01\u0e47\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e19\u0e35\u0e49 \u0e41\u0e15\u0e48\u0e01\u0e48\u0e2d\u0e19\u0e08\u0e30\u0e44\u0e14\u0e49\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e19\u0e35\u0e49\u0e21\u0e32\u0e40\u0e23\u0e32\u0e01\u0e47\u0e21\u0e31\u0e01\u0e08\u0e30\u0e21\u0e35\u0e41\u0e2b\u0e25\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e14\u0e34\u0e1a\u0e27\u0e48\u0e32\u0e04\u0e19\u0e19\u0e35\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e43\u0e04\u0e23 \u0e2d\u0e32\u0e22\u0e38\u0e40\u0e17\u0e48\u0e32\u0e44\u0e2b\u0e23\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e23\u0e49\u0e2d\u0e22\u0e40\u0e1b\u0e47\u0e19\u0e25\u0e49\u0e32\u0e19\u0e40\u0e23\u0e04\u0e04\u0e2d\u0e23\u0e4c\u0e14 \u0e41\u0e25\u0e49\u0e27\u0e04\u0e48\u0e2d\u0e22\u0e21\u0e32\u0e41\u0e22\u0e01\u0e15\u0e32\u0e21\u0e01\u0e25\u0e48\u0e38\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2d\u0e35\u0e01\u0e17\u0e35 \u0e43\u0e19\u0e17\u0e35\u0e48\u0e19\u0e35\u0e49\u0e40\u0e23\u0e32\u0e08\u0e30\u0e41\u0e22\u0e01\u0e15\u0e32\u0e21\u0e01\u0e25\u0e38\u0e48\u0e21\u0e2d\u0e32\u0e22\u0e38\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e44\u0e14\u0e49\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e33\u0e44\u0e1b\u0e1e\u0e25\u0e47\u0e2d\u0e15\u0e01\u0e23\u0e32\u0e1f\u0e43\u0e19\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e02\u0e49\u0e32\u0e07\u0e1a\u0e19<\/p>\n<p>\u0e2a\u0e21\u0e21\u0e38\u0e15\u0e34\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a\u0e2a\u0e21\u0e21\u0e38\u0e15\u0e34\u0e40\u0e23\u0e32\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e01\u0e25\u0e38\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e0a\u0e48\u0e27\u0e07 \u0e46 \u0e25\u0e30 5 \u0e1b\u0e35\u0e2b\u0e25\u0e48\u0e30\u0e01\u0e31\u0e19 \u0e08\u0e32\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e1a\u0e1a\u0e14\u0e31\u0e21\u0e21\u0e35\u0e48\u0e02\u0e36\u0e49\u0e19\u0e21\u0e32 (\u0e40\u0e23\u0e32\u0e43\u0e0a\u0e49\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23\u0e08\u0e32\u0e01\u0e40\u0e27\u0e47\u0e1a <a href=\"http:\/\/www.generatedata.com\/\" target=\"_blank\">generatedata.com<\/a> \u0e19\u0e30 \u0e2a\u0e30\u0e14\u0e27\u0e01\u0e14\u0e35)<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">DROP TABLE `persondemo`;\r\n\r\nCREATE TABLE `persondemo` (\r\n  `id` mediumint(8) unsigned NOT NULL auto_increment,\r\n  `age` mediumint default NULL,\r\n  PRIMARY KEY (`id`)\r\n) AUTO_INCREMENT=1;\r\n\r\nINSERT INTO `persondemo` (`age`) VALUES (11),(88),(73),(75),(8),(45),(40),(61),(62),(69),(28),(1),(84),(5),(13),(75),(76),(78),(45),(35),(23),(52),(56),(40),(91),(6),(61),(41),(52),(42),(33),(90),(4),(55),(90),(75),(97),(28),(36),(2),(51),(46),(49),(79),(87),(22),(76),(3),(9),(56),(23),(45),(56),(85),(65),(30),(31),(21),(13),(36),(88),(22),(20),(16),(73),(95),(17),(56),(29),(94),(59),(38),(31),(36),(47),(37),(33),(3),(90),(22),(41),(85),(76),(90),(54),(58),(73),(30),(12),(4),(3),(38),(78),(78),(26),(85),(78),(68),(31),(11);\r\n<\/pre>\n<p>\u0e27\u0e34\u0e18\u0e35\u0e41\u0e23\u0e01 \u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 SQL \u0e17\u0e35\u0e48\u0e21\u0e31\u0e01\u0e40\u0e2b\u0e47\u0e19\u0e2d\u0e22\u0e39\u0e48\u0e1a\u0e48\u0e2d\u0e22 \u0e46 \u0e43\u0e19\u0e01\u0e32\u0e23\u0e41\u0e1a\u0e48\u0e07\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e01\u0e47\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 CASE ..WHEN \u0e21\u0e35\u0e01\u0e35\u0e48\u0e0a\u0e48\u0e27\u0e07\u0e01\u0e47\u0e41\u0e1a\u0e48\u0e07\u0e44\u0e1b<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT  SUM(CASE WHEN COL1 BETWEEN 0 AND 4 THEN 1 END)\r\n,       SUM(CASE WHEN COL1 BETWEEN 5 AND 9 THEN 1 END)\r\n,       SUM(CASE WHEN COL1 BETWEEN 10 AND 14 THEN 1 END)\r\n,       SUM(CASE WHEN COL1 BETWEEN 15 AND 19 THEN 1 END)\r\n,       SUM(CASE WHEN COL1 BETWEEN 20 AND 24 THEN 1 END)\r\n... \r\n... \r\n... \r\nFROM YOURTABLE \r\n...\r\n<\/pre>\n<p>\u0e2d\u0e35\u0e01\u0e27\u0e34\u0e18\u0e35\u0e19\u0e36\u0e07 \u0e01\u0e47\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e17\u0e32\u0e07\u0e04\u0e13\u0e34\u0e15\u0e28\u0e32\u0e2a\u0e15\u0e23\u0e4c\u0e02\u0e2d\u0e07 SQL \u0e40\u0e2d\u0e07 \u0e27\u0e31\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e40\u0e2a\u0e19\u0e2d FLOOR() \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e21\u0e32\u0e04\u0e33\u0e19\u0e27\u0e13\u0e2b\u0e32\u0e0a\u0e48\u0e27\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u0e19\u0e35\u0e49\u0e44\u0e1b\u0e2d\u0e48\u0e32\u0e19\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e40\u0e2d\u0e32\u0e2b\u0e25\u0e48\u0e30\u0e01\u0e31\u0e19\u0e19\u0e30 ^_^<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">\r\nSELECT\r\n    CONCAT(5 * FLOOR((age\/5)), ' - ', 5 * FLOOR((age\/5)) + 4) AS `range`,\r\n    COUNT(id) AS `NumberOfPerson`\r\nFROM `persondemo`\r\nGROUP BY 1\r\nORDER BY 5 * FLOOR((age\/5))\r\n<\/pre>\n<p>\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e01\u0e47\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e19\u0e35\u0e49<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\r\n+---------+----------------+\r\n| range   | NumberOfPerson |\r\n+---------+----------------+\r\n| 0 - 4   |              7 |\r\n| 5 - 9   |              4 |\r\n| 10 - 14 |              5 |\r\n| 15 - 19 |              2 |\r\n| 20 - 24 |              7 |\r\n| 25 - 29 |              4 |\r\n| 30 - 34 |              7 |\r\n| 35 - 39 |              7 |\r\n| 40 - 44 |              5 |\r\n| 45 - 49 |              6 |\r\n| 50 - 54 |              4 |\r\n| 55 - 59 |              7 |\r\n| 60 - 64 |              3 |\r\n| 65 - 69 |              3 |\r\n| 70 - 74 |              3 |\r\n| 75 - 79 |             11 |\r\n| 80 - 84 |              1 |\r\n| 85 - 89 |              6 |\r\n| 90 - 94 |              6 |\r\n| 95 - 99 |              2 |\r\n+---------+----------------+\r\n20 rows in set (0.00 sec)\r\n<\/pre>\n<p>\u0e14\u0e36\u0e01\u0e21\u0e32\u0e01\u0e41\u0e25\u0e49\u0e27 \u0e19\u0e2d\u0e19\u0e40\u0e2b\u0e2d\u0e30 \u0e19\u0e30 ^_^<\/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=139\" 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=MySQL%20:%20Select%20the%20count%20of%20values%20grouped%20by%20ranges&Body=Here%20is%20the%20link%20to%20the%20article:%20https:\/\/www.oopsbox.com\/?p=139\" 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>\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e40\u0e04\u0e22\u0e40\u0e2b\u0e47\u0e19\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e23\u0e32\u0e1f\u0e17\u0e35\u0e48\u0e19\u0e33\u0e40\u0e2a\u0e19\u0e2d\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e02\u0e2d\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e17\u0e35\u0e48\u0e40\u0e2b\u0e47\u0e19\u0e01\u0e31\u0e19\u0e1a\u0e48\u0e2d\u0e22 \u0e46 \u0e01\u0e47\u0e40\u0e0a\u0e48\u0e19\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e1b\u0e34\u0e23\u0e32\u0e21\u0e34\u0e14\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e0a\u0e31\u0e14\u0e40\u0e25\u0e22 \u0e44\u0e21\u0e48\u0e04\u0e38\u0e49\u0e19\u0e01\u0e47\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e19\u0e35\u0e49 (\u0e19\u0e35\u0e48\u0e2d\u0e49\u0e32\u0e07\u0e2d\u0e34\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e38\u0e02\u0e20\u0e32\u0e1e\u0e02\u0e2d\u0e07\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14\u0e40\u0e23\u0e32\u0e40\u0e25\u0e22)<\/p>\n","protected":false},"author":1,"featured_media":141,"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,20],"class_list":["post-139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-note","tag-mysql","tag-sql","entry"],"views":5700,"_links":{"self":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/139","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=139"}],"version-history":[{"count":7,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions\/149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/media\/141"}],"wp:attachment":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}