{"id":293,"date":"2016-12-20T15:37:47","date_gmt":"2016-12-20T08:37:47","guid":{"rendered":"http:\/\/www.oopsbox.com\/?p=293"},"modified":"2016-12-21T11:19:36","modified_gmt":"2016-12-21T04:19:36","slug":"last-record-in-each-group","status":"publish","type":"post","link":"https:\/\/www.oopsbox.com\/?p=293","title":{"rendered":"Last record in each group"},"content":{"rendered":"<p>\u0e43\u0e19 MySQL \u0e01\u0e23\u0e13\u0e35\u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2b\u0e32\u0e04\u0e48\u0e32\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u00a0\u0e15\u0e33\u0e2a\u0e38\u0e14 \u0e43\u0e19\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e31\u0e49\u0e19 \u0e46 \u0e08\u0e30\u0e2b\u0e32\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e48\u0e19 MIN() \u0e0b\u0e36\u0e48\u0e07\u0e08\u0e30\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32\u0e15\u0e33\u0e2a\u0e38\u0e14\u0e41\u0e25\u0e30 MAX() \u0e08\u0e30\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u0e43\u0e19\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e17\u0e35\u0e48\u0e23\u0e30\u0e1a\u0e38 \u0e40\u0e0a\u0e48\u0e19<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT MIN(column_name) FROM TABLE_NAME<\/pre>\n<p>\u0e01\u0e23\u0e13\u0e35\u0e17\u0e35\u0e48\u0e2b\u0e32\u0e04\u0e48\u0e32\u0e15\u0e48\u0e33\u0e2a\u0e38\u0e14\/\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14 \u0e41\u0e22\u0e01\u0e15\u0e32\u0e21 \u0e01\u0e25\u0e38\u0e48\u0e21\u0e43\u0e14 \u0e46 \u0e01\u0e47\u0e15\u0e32\u0e21\u0e40\u0e1e\u0e35\u0e22\u0e07\u0e41\u0e04\u0e48\u0e43\u0e0a\u0e49 GROUP BY \u0e15\u0e48\u0e2d\u0e41\u0e04\u0e48\u0e19\u0e31\u0e49\u0e19<\/p>\n<p>\u0e08\u0e1a\u0e41\u0e25\u0e49\u0e27\u0e40\u0e2b\u0e23\u0e2d \u0e40\u0e14\u0e4b\u0e27\u0e01\u0e48\u0e2d\u0e19\u0e19\u0e19\u0e19\u0e19\u0e19 !!! \u0e0a\u0e35\u0e27\u0e34\u0e15\u0e21\u0e31\u0e19\u0e44\u0e21\u0e48\u0e07\u0e48\u0e32\u0e22\u0e02\u0e19\u0e32\u0e14\u0e19\u0e31\u0e49\u0e19 \u0e21\u0e31\u0e19\u0e08\u0e30\u0e21\u0e35\u0e04\u0e27\u0e32\u0e21\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e35\u0e01\u0e01\u0e23\u0e13\u0e35\u0e19\u0e36\u0e07\u0e04\u0e37\u0e2d<\/p>\n<blockquote><p>\u0e2d\u0e22\u0e32\u0e01\u0e44\u0e14\u0e49\u0e04\u0e48\u0e32 X \u0e43\u0e19\u0e40\u0e23\u0e04\u0e04\u0e2d\u0e23\u0e4c\u0e14\u0e17\u0e35\u0e48\u0e21\u0e35\u0e04\u0e48\u0e32\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u0e43\u0e19\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e17\u0e35\u0e48\u0e23\u0e30\u0e1a\u0e38 (Y) \u0e41\u0e15\u0e48\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e04\u0e48\u0e32 Y \u0e19\u0e30 \u0e41\u0e22\u0e01\u0e15\u0e32\u0e21\u0e01\u0e25\u0e48\u0e38\u0e21 Z<\/p><\/blockquote>\n<p>\u0e14\u0e39\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-298\" src=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_074.jpg\" alt=\"\" width=\"653\" height=\"260\" srcset=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_074.jpg 653w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_074-300x119.jpg 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><br \/>\n\u0e04\u0e48\u0e32 X \u0e04\u0e37\u0e2d LABRESULT<br \/>\n\u0e04\u0e48\u0e32 Y \u0e04\u0e37\u0e2d DATE_SERV<br \/>\n\u0e04\u0e48\u0e32 Z \u0e04\u0e37\u0e2d CID<\/p>\n<p>\u0e40\u0e1e\u0e23\u0e32\u0e30\u0e09\u0e30\u0e19\u0e31\u0e49\u0e19\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e04\u0e27\u0e23\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e0a\u0e48\u0e19\u0e19\u0e35\u0e49 \u0e17\u0e35\u0e48\u0e40\u0e18\u0e2d\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-297\" src=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_075.jpg\" alt=\"\" width=\"641\" height=\"132\" srcset=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_075.jpg 641w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_075-300x62.jpg 300w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><br \/>\n\u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e35\u0e22\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e44\u0e14\u0e49\u0e2b\u0e25\u0e32\u0e22\u0e41\u0e1a\u0e1a \u0e2d\u0e32\u0e17\u0e34<\/p>\n<p><strong>\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 1<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT * FROM (\r\n    SELECT HOSPCODE,CID,DATE_SERV,LABTEST,LABRESULT FROM demolasteachgroup ORDER BY DATE_SERV DESC\r\n) t1 GROUP BY CID;<\/pre>\n<p><strong>\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 2<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT *\r\nFROM demolasteachgroup\r\nWHERE DATE_SERV IN (\r\n    SELECT MAX(DATE_SERV)\r\n    FROM demolasteachgroup\r\n    GROUP BY CID\r\n);<\/pre>\n<p><strong>\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 3<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT\r\n    t1.*\r\nFROM demolasteachgroup t1 \r\n    LEFT JOIN demolasteachgroup t2 ON (t1.CID = t2.CID AND t1.DATE_SERV &lt; t2.DATE_SERV)\r\nWHERE t2.CID IS NULL;<\/pre>\n<p>\u0e1b\u0e25 1. \u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e1e\u0e1a\u0e27\u0e48\u0e32<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><strong>MySQL Version<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 1<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 2<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 3<\/strong><\/td>\n<\/tr>\n<tr>\n<td>5.5<\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<\/tr>\n<tr>\n<td>5.6<\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<\/tr>\n<tr>\n<td>5.7<\/td>\n<td style=\"text-align: center;\"><strong>\u00d7<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<\/tr>\n<tr>\n<td>10.2.2 (MariaDB)<\/td>\n<td style=\"text-align: center;\"><strong>\u00d7<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>\u221a<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><em>\u221a\u00a0 \u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07<\/em><br \/>\n<em> \u00d7 \u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e1c\u0e34\u0e14<\/em><\/p>\n<p>\u0e1b\u0e25. 2 \u0e15\u0e31\u0e14\u0e40\u0e07\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e02\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07 Big O \u0e19\u0e30 \u0e21\u0e2d\u0e07\u0e16\u0e36\u0e07\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e40\u0e14\u0e35\u0e22\u0e27<\/p>\n<p>\u0e1b\u0e25. 3 \u0e21\u0e35\u0e1b\u0e23\u0e30\u0e40\u0e14\u0e47\u0e19\u0e2a\u0e07\u0e2a\u0e31\u0e22\u0e08\u0e32\u0e01\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e19\u0e43\u0e19\u0e27\u0e07\u0e01\u0e32\u0e23(\u0e2a\u0e38\u0e02\u0e20\u0e32\u0e1e) \u0e16\u0e32\u0e21\u0e21\u0e32\u0e17\u0e35\u0e48\u0e08\u0e31\u0e1a\u0e43\u0e08\u0e04\u0e27\u0e32\u0e21\u0e44\u0e14\u0e49\u0e01\u0e47 (\u0e16\u0e49\u0e32\u0e21\u0e35\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e01\u0e47 discuss \u0e01\u0e31\u0e19\u0e44\u0e14\u0e49\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a \u0e22\u0e34\u0e19\u0e14\u0e35)<br \/>\nQ : \u0e22\u0e01\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e23\u0e39\u0e1b\u0e18\u0e23\u0e23\u0e21\u0e40\u0e2b\u0e47\u0e19\u0e44\u0e14\u0e49\u0e2b\u0e19\u0e48\u0e2d\u0e22\u0e17\u0e35\u0e48\u0e1a\u0e2d\u0e01\u0e27\u0e48\u0e32<strong>\u0e04\u0e27\u0e32\u0e21\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e35\u0e01\u0e01\u0e23\u0e13\u0e35\u0e19\u0e36\u0e07<\/strong><br \/>\nA : \u0e40\u0e0a\u0e48\u0e19 \u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2b\u0e32\u0e04\u0e48\u0e32\u0e19\u0e49\u0e33\u0e15\u0e32\u0e25\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14<sup>xx<\/sup>\u0e02\u0e2d\u0e07\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22\u0e2b\u0e23\u0e37\u0e2d\u0e1c\u0e25\u0e41\u0e25\u0e1b HbA1C \u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14\u0e02\u0e2d\u0e07\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22 \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e19 \u0e01\u0e23\u0e13\u0e35\u0e2b\u0e32\u0e01\u0e44\u0e14\u0e49\u0e04\u0e48\u0e32\u0e17\u0e35\u0e48\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14\u0e2d\u0e2d\u0e01\u0e21\u0e32\u0e21\u0e35\u0e1c\u0e25\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e21\u0e32\u0e01 \u0e40\u0e1e\u0e23\u0e32\u0e30 2 \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e02\u0e49\u0e32\u0e07\u0e15\u0e49\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e43\u0e19\u0e40\u0e07\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e02\u0e17\u0e35\u0e48\u0e1a\u0e2d\u0e01\u0e16\u0e36\u0e07\u0e01\u0e32\u0e23\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21\u0e19\u0e49\u0e33\u0e15\u0e32\u0e25\u0e44\u0e14\u0e49\u0e14\u0e35\u0e02\u0e2d\u0e07\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22 \u0e0b\u0e36\u0e48\u0e07\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 KPI \u0e17\u0e38\u0e01 \u0e46 \u0e1b\u0e35\u0e02\u0e2d\u0e07\u0e04\u0e19\u0e17\u0e33\u0e07\u0e32\u0e19\u0e14\u0e49\u0e32\u0e19\u0e2a\u0e38\u0e02\u0e20\u0e32\u0e1e (\u0e04\u0e19\u0e44\u0e17\u0e22\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e1a\u0e32\u0e2b\u0e27\u0e32\u0e19\u0e40\u0e22\u0e2d\u0e30\u0e21\u0e32\u0e01\u0e19\u0e30 \u0e2d\u0e31\u0e19\u0e19\u0e35\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e48\u0e32\u0e01\u0e31\u0e07\u0e27\u0e25\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19) KPI \u0e40\u0e01\u0e37\u0e2d\u0e1a\u0e1c\u0e48\u0e32\u0e19\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e01\u0e37\u0e2d\u0e1a\u0e44\u0e21\u0e48\u0e1c\u0e48\u0e32\u0e19\u0e04\u0e27\u0e32\u0e21\u0e23\u0e38\u0e19\u0e41\u0e23\u0e07\u0e43\u0e19\u0e01\u0e32\u0e23\u0e15\u0e33\u0e2b\u0e19\u0e34\u0e15\u0e48\u0e32\u0e07\u0e01\u0e31\u0e19\u0e40\u0e22\u0e2d\u0e30 ^_^<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-300\" src=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_076-1024x338.jpg\" alt=\"\" width=\"687\" height=\"227\" srcset=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_076-1024x338.jpg 1024w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_076-300x99.jpg 300w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_076-768x254.jpg 768w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_076-800x264.jpg 800w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_076.jpg 1154w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/p>\n<p>Q : \u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e01\u0e31\u0e1a MySQL \u0e04\u0e19\u0e25\u0e30 Version \u0e43\u0e2b\u0e49\u0e1c\u0e25\u0e44\u0e21\u0e48\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19 \u0e2d\u0e30\u0e44\u0e23 \u0e22\u0e31\u0e07\u0e44\u0e07<br \/>\nA : \u0e17\u0e35\u0e48\u0e43\u0e2b\u0e49\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e44\u0e21\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07\u0e19\u0e31\u0e49\u0e19 \u0e40\u0e09\u0e1e\u0e32\u0e30\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 1 \u0e19\u0e30 \u0e15\u0e32\u0e21\u0e1b\u0e25. 1 \u0e04\u0e37\u0e2d\u0e15\u0e31\u0e27\u0e19\u0e35\u0e49<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT * FROM (\r\n    SELECT HOSPCODE,CID,DATE_SERV,LABTEST,LABRESULT FROM demolasteachgroup ORDER BY DATE_SERV DESC\r\n) t1 GROUP BY CID;<\/pre>\n<p>\u0e14\u0e39\u0e23\u0e39\u0e1b\u0e2b\u0e25\u0e48\u0e30\u0e01\u0e31\u0e19 \u0e40\u0e23\u0e32\u0e08\u0e31\u0e14\u0e40\u0e23\u0e35\u0e22\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2b\u0e32\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14 \u0e01\u0e27\u0e32\u0e14 \u0e46 \u0e14\u0e49\u0e27\u0e22\u0e15\u0e32\u0e08\u0e30\u0e40\u0e2b\u0e47\u0e19\u0e27\u0e48\u0e32\u0e01\u0e23\u0e2d\u0e1a\u0e2a\u0e35\u0e41\u0e14\u0e07\u0e04\u0e37\u0e2d\u0e40\u0e23\u0e04\u0e04\u0e2d\u0e23\u0e4c\u0e14\u0e17\u0e35\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07 \u0e17\u0e35\u0e48\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 SQL \u0e04\u0e27\u0e23\u0e08\u0e30\u0e04\u0e37\u0e19\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e21\u0e32<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-302\" src=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_074-1.jpg\" alt=\"\" width=\"653\" height=\"260\" srcset=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_074-1.jpg 653w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_074-1-300x119.jpg 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/p>\n<p>\u0e41\u0e15\u0e48\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e08\u0e30\u0e1c\u0e34\u0e14\u0e17\u0e31\u0e19\u0e17\u0e35\u0e16\u0e49\u0e32\u0e43\u0e0a\u0e49 MySQL Version 5.7 \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e19\u0e44\u0e1b (\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e48\u0e19 5.7.17)<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-301\" src=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_077.jpg\" alt=\"\" width=\"579\" height=\"137\" srcset=\"https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_077.jpg 579w, https:\/\/www.oopsbox.com\/wp-content\/uploads\/Selection_077-300x71.jpg 300w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/p>\n<p>** \u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e2b\u0e32\u0e2a\u0e32\u0e40\u0e2b\u0e15\u0e38\u0e19\u0e30\u0e27\u0e48\u0e32\u0e1c\u0e34\u0e14\u0e40\u0e1e\u0e23\u0e32\u0e30\u0e2d\u0e30\u0e44\u0e23 \u0e43\u0e04\u0e23\u0e08\u0e30\u0e25\u0e2d\u0e07\u0e44\u0e1b\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e48\u0e19\u0e2d\u0e37\u0e48\u0e19 \u0e46 \u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e01\u0e47\u0e15\u0e32\u0e21\u0e19\u0e35\u0e49<br \/>\n<span data-ft=\"{&quot;tn&quot;:&quot;K&quot;}\"><span class=\"UFICommentBody\">MySQL 5.5 &#8211; <a class=\"\" dir=\"ltr\" href=\"http:\/\/l.facebook.com\/l.php?u=http%3A%2F%2Fsqlfiddle.com%2F%23%212%2F38ef1b%2F2&amp;h=eAQFgR3KK\" target=\"_blank\" rel=\"nofollow\">http:\/\/sqlfiddle.com\/#!2\/38ef1b\/2<\/a><br \/>\nMySQL 5.6 &#8211; <a class=\"\" dir=\"ltr\" href=\"http:\/\/l.facebook.com\/l.php?u=http%3A%2F%2Fsqlfiddle.com%2F%23%219%2F38ef1b%2F4&amp;h=sAQFP060q\" target=\"_blank\" rel=\"nofollow\">http:\/\/sqlfiddle.com\/#!9\/38ef1b\/4<\/a><br \/>\nMySQL 5.7 &#8211; <a class=\"\" dir=\"ltr\" href=\"http:\/\/l.facebook.com\/l.php?u=http%3A%2F%2Frextester.com%2FJALDD35756&amp;h=dAQHLygtZ\" target=\"_blank\" rel=\"nofollow\">http:\/\/rextester.com\/JALDD35756<\/a><\/span><\/span><\/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=293\" 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=Last%20record%20in%20each%20group&Body=Here%20is%20the%20link%20to%20the%20article:%20https:\/\/www.oopsbox.com\/?p=293\" 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>\u0e43\u0e19 MySQL \u0e01\u0e23\u0e13\u0e35\u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2b\u0e32\u0e04\u0e48\u0e32\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u00a0\u0e15\u0e33\u0e2a\u0e38\u0e14 \u0e43\u0e19\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e31\u0e49\u0e19 \u0e46 \u0e08\u0e30\u0e2b\u0e32\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e48\u0e19 MIN() \u0e0b\u0e36\u0e48\u0e07\u0e08\u0e30\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32\u0e15\u0e33\u0e2a\u0e38\u0e14\u0e41\u0e25\u0e30 MAX() \u0e08\u0e30\u0e04\u0e37\u0e19\u0e04\u0e48\u0e32\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u0e43\u0e19\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e17\u0e35\u0e48\u0e23\u0e30\u0e1a\u0e38 \u0e40\u0e0a\u0e48\u0e19 SELECT MIN(column_name) FROM TABLE_NAME \u0e01\u0e23\u0e13\u0e35\u0e17\u0e35\u0e48\u0e2b\u0e32\u0e04\u0e48\u0e32\u0e15\u0e48\u0e33\u0e2a\u0e38\u0e14\/\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14 \u0e41\u0e22\u0e01\u0e15\u0e32\u0e21 \u0e01\u0e25\u0e38\u0e48\u0e21\u0e43\u0e14 \u0e46 \u0e01\u0e47\u0e15\u0e32\u0e21\u0e40\u0e1e\u0e35\u0e22\u0e07\u0e41\u0e04\u0e48\u0e43\u0e0a\u0e49 GROUP BY \u0e15\u0e48\u0e2d\u0e41\u0e04\u0e48\u0e19\u0e31\u0e49\u0e19 \u0e08\u0e1a\u0e41\u0e25\u0e49\u0e27\u0e40\u0e2b\u0e23\u0e2d \u0e40\u0e14\u0e4b\u0e27\u0e01\u0e48\u0e2d\u0e19\u0e19\u0e19\u0e19\u0e19\u0e19 !!! \u0e0a\u0e35\u0e27\u0e34\u0e15\u0e21\u0e31\u0e19\u0e44\u0e21\u0e48\u0e07\u0e48\u0e32\u0e22\u0e02\u0e19\u0e32\u0e14\u0e19\u0e31\u0e49\u0e19 \u0e21\u0e31\u0e19\u0e08\u0e30\u0e21\u0e35\u0e04\u0e27\u0e32\u0e21\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e35\u0e01\u0e01\u0e23\u0e13\u0e35\u0e19\u0e36\u0e07\u0e04\u0e37\u0e2d \u0e2d\u0e22\u0e32\u0e01\u0e44\u0e14\u0e49\u0e04\u0e48\u0e32 X \u0e43\u0e19\u0e40\u0e23\u0e04\u0e04\u0e2d\u0e23\u0e4c\u0e14\u0e17\u0e35\u0e48\u0e21\u0e35\u0e04\u0e48\u0e32\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u0e43\u0e19\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e17\u0e35\u0e48\u0e23\u0e30\u0e1a\u0e38 (Y) \u0e41\u0e15\u0e48\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e04\u0e48\u0e32 Y \u0e19\u0e30 \u0e41\u0e22\u0e01\u0e15\u0e32\u0e21\u0e01\u0e25\u0e48\u0e38\u0e21 Z \u0e14\u0e39\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32 \u0e04\u0e48\u0e32 X \u0e04\u0e37\u0e2d LABRESULT \u0e04\u0e48\u0e32 Y \u0e04\u0e37\u0e2d DATE_SERV \u0e04\u0e48\u0e32 Z \u0e04\u0e37\u0e2d CID \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e09\u0e30\u0e19\u0e31\u0e49\u0e19\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e04\u0e27\u0e23\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e0a\u0e48\u0e19\u0e19\u0e35\u0e49 \u0e17\u0e35\u0e48\u0e40\u0e18\u0e2d\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e35\u0e22\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e44\u0e14\u0e49\u0e2b\u0e25\u0e32\u0e22\u0e41\u0e1a\u0e1a \u0e2d\u0e32\u0e17\u0e34 \u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.oopsbox.com\/?p=293\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Last record in each group&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":290,"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":[5],"tags":[12],"class_list":["post-293","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-mysql","entry"],"views":2774,"_links":{"self":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/293","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=293"}],"version-history":[{"count":6,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/293\/revisions"}],"predecessor-version":[{"id":304,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/posts\/293\/revisions\/304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=\/wp\/v2\/media\/290"}],"wp:attachment":[{"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oopsbox.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}