{"id":5581,"date":"2020-10-13T08:47:11","date_gmt":"2020-10-13T08:47:11","guid":{"rendered":"https:\/\/www.codebee.co.th\/labs\/?p=5581"},"modified":"2021-02-25T03:18:50","modified_gmt":"2021-02-25T03:18:50","slug":"%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5-query-%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b9%83%e0%b8%99-mysql-%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%81%e0%b8%b3%e0%b8%ab%e0%b8%99%e0%b8%94","status":"publish","type":"post","link":"https:\/\/www.codebee.co.th\/labs\/%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5-query-%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b9%83%e0%b8%99-mysql-%e0%b9%81%e0%b8%9a%e0%b8%9a%e0%b8%81%e0%b8%b3%e0%b8%ab%e0%b8%99%e0%b8%94\/","title":{"rendered":"\u0e27\u0e34\u0e18\u0e35 Query \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e43\u0e19 MySQL \u0e41\u0e1a\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><\/figure>\n\n\n\n<p>\u0e27\u0e34\u0e18\u0e35 Query \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e43\u0e19 MySQL \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16 Query \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e21\u0e32\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25 \u0e41\u0e1a\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e40\u0e01\u0e34\u0e14\u0e02\u0e36\u0e49\u0e19\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e15\u0e48\u0e25\u0e30 row \u0e44\u0e14\u0e49 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e08\u0e33\u0e01\u0e31\u0e14\u0e02\u0e2d\u0e1a\u0e40\u0e02\u0e15\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e0b\u0e36\u0e48\u0e07\u0e2d\u0e32\u0e08\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e15\u0e32\u0e21\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32 \u0e2b\u0e23\u0e37\u0e2d \u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e19\u0e31\u0e49\u0e19 \u0e46 \u0e44\u0e14\u0e49<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>\u0e43\u0e0a\u0e49 DATE_SUB() \u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e39\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e1a\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e22\u0e49\u0e2d\u0e19\u0e2b\u0e25\u0e31\u0e07 ( \u0e25\u0e1a\u0e27\u0e31\u0e19\u0e40\u0e27\u0e25\u0e32 )<\/strong><\/p>\n\n\n\n<p>\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 NOW(), BETWEEN \u0e41\u0e25\u0e30 INTERVAL DAY \u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e39\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e22\u0e49\u0e2d\u0e19\u0e2b\u0e25\u0e31\u0e07\u0e44\u0e1b 5 \u0e27\u0e31\u0e19 \u0e19\u0e31\u0e1a\u0e08\u0e32\u0e01\u0e27\u0e31\u0e19\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19 \u0e42\u0e14\u0e22\u0e19\u0e33\u0e40\u0e27\u0e25\u0e32\u0e21\u0e32\u0e04\u0e33\u0e19\u0e27\u0e13\u0e14\u0e49\u0e27\u0e22 \u0e40\u0e02\u0e35\u0e22\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e44\u0e14\u0e49\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT * FROM table WHERE timestamp BETWEEN DATE_SUB(NOW(), INTERVAL 5 DAY) AND NOW()<\/code><\/pre>\n\n\n\n<p>\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 CURDATE(), BETWEEN \u0e41\u0e25\u0e30 INTERVAL DAY \u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e39\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e22\u0e49\u0e2d\u0e19\u0e2b\u0e25\u0e31\u0e07\u0e44\u0e1b 5 \u0e27\u0e31\u0e19 \u0e19\u0e31\u0e1a\u0e08\u0e32\u0e01\u0e27\u0e31\u0e19\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19 \u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e19\u0e33\u0e40\u0e27\u0e25\u0e32\u0e21\u0e32\u0e04\u0e33\u0e19\u0e27\u0e13\u0e14\u0e49\u0e27\u0e22 \u0e40\u0e02\u0e35\u0e22\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e44\u0e14\u0e49\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT * FROM table WHERE timestamp BETWEEN DATE_SUB(CURDATE(), INTERVAL 5 DAY) AND CURDATE()<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>\u0e43\u0e0a\u0e49 DATE_ADD() \u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e39\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e1a\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e36\u0e49\u0e19 ( \u0e1a\u0e27\u0e01\u0e27\u0e31\u0e19\u0e40\u0e27\u0e25\u0e32 ) <\/strong><\/p>\n\n\n\n<p>\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 DATE_ADD, BETWEEN \u0e41\u0e25\u0e30 INTERVAL DAY \u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e39\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48 2020-10-10 \u0e1a\u0e27\u0e01\u0e40\u0e1e\u0e34\u0e48\u0e21 5 \u0e27\u0e31\u0e19 \u0e08\u0e19\u0e16\u0e36\u0e07\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48 2020-10-15  \u0e42\u0e14\u0e22\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19 &#8216;2020-10-10&#8217; \u0e43\u0e2b\u0e49\u0e40\u0e23\u0e32\u0e41\u0e17\u0e19\u0e04\u0e48\u0e32\u0e14\u0e49\u0e27\u0e22\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 \u0e42\u0e14\u0e22\u0e40\u0e02\u0e35\u0e22\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e44\u0e14\u0e49\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SELECT * FROM table WHERE timestamp BETWEEN DATE('2020-10-10') AND DATE_ADD('2020-10-10', INTERVAL 6 DAY)<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e27\u0e34\u0e18\u0e35 Query \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e43\u0e19 MySQL \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16 Query \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e21\u0e32\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25 \u0e41\u0e1a\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e40\u0e01\u0e34\u0e14\u0e02\u0e36\u0e49\u0e19\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e15\u0e48\u0e25\u0e30 row \u0e44\u0e14\u0e49 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e08\u0e33\u0e01\u0e31\u0e14\u0e02\u0e2d\u0e1a\u0e40\u0e02\u0e15\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e0b\u0e36\u0e48\u0e07\u0e2d\u0e32\u0e08\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e15\u0e32\u0e21\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32 \u0e2b\u0e23\u0e37\u0e2d \u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e19\u0e31\u0e49\u0e19 \u0e46 \u0e44\u0e14\u0e49 \u0e43\u0e0a\u0e49 DATE_SUB() \u0e40\u0e23\u0e35\u0e22\u0e01\u0e14\u0e39\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e1a\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e27\u0e25\u0e32\u0e22\u0e49\u0e2d\u0e19\u0e2b\u0e25\u0e31\u0e07&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"video","meta":{"footnotes":""},"categories":[2284,1,46],"tags":[2264,2263,2267,1677,2265,2268,2266,2246,2262],"class_list":["post-5581","post","type-post","status-publish","format-video","has-post-thumbnail","hentry","category--database","category-1","category-website-development-","tag-date_add","tag-date_sub","tag-interval-day","tag-mysql","tag-mysql-between","tag-mysql-database","tag-select-","tag--mysql","tag--query-","post_format-post-format-video"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/5581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/comments?post=5581"}],"version-history":[{"count":7,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/5581\/revisions"}],"predecessor-version":[{"id":5932,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/5581\/revisions\/5932"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/media\/5586"}],"wp:attachment":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/media?parent=5581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/categories?post=5581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/tags?post=5581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}