{"id":11622,"date":"2021-09-09T13:32:15","date_gmt":"2021-09-09T04:32:15","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=11622"},"modified":"2025-04-21T14:39:52","modified_gmt":"2025-04-21T05:39:52","slug":"postgresql%ec%9d%98-timestamp-%ed%83%80%ec%9e%85%ec%97%90-%eb%8c%80%ed%95%9c-%ec%bf%bc%eb%a6%ac","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=11622","title":{"rendered":"PostgreSQL\uc758 TimeStamp \ud0c0\uc785\uc5d0 \ub300\ud55c \ucffc\ub9ac"},"content":{"rendered":"<p>PostgreSQL\uc5d0\uc11c \ub0a0\uc9dc\uc640 \uc2dc\uac04\uc744 \ud558\ub098\uc758 \ud544\ub4dc\ub85c \uc800\uc7a5\ud560 \uc218 \uc788\ub294 \ud0c0\uc785\uc740 Timestamp\uc785\ub2c8\ub2e4. \ud504\ub85c\uc81d\ud2b8\ub97c \uc9c4\ud589\ud558\uba74\uc11c \uc774 TimeStamp\uc5d0 \ub300\ud55c \ucffc\ub9ac\uc5d0 \ub300\ud574 \uc815\ub9ac\ud574 \ubcf4\uace0\uc790 \ud569\ub2c8\ub2e4. \uc0ac\uc6a9\ud55c \ud14c\uc774\ube14\uc740 \uc5ec\ub7ec\ubd84\uacfc \ub2e4\ub97c \uc218 \uc788\uc73c\ub2c8 \ucffc\ub9ac \uacb0\uacfc\uc5d0 \ub300\ud574\uc11c\ub294 \uc720\uc5f0\ud558\uac8c \ucc38\uace0\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4. \uadf8\ub9ac\uace0 Timestamp \ud0c0\uc785\uc758 \ud544\ub4dc\ub294 sample_time\uc785\ub2c8\ub2e4.<\/p>\n<p>\uba3c\uc800 2021\ub144 8\uc6d4 21\uc77c 12\uc2dc 30\ubd84 \uc774\ud6c4\uc5d0 \ubc1c\uc0dd\ud55c \ub370\uc774\ud130\ub97c \uc5bb\uc5b4\uc624\uae30 \uc704\ud55c \ucffc\ub9ac\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">\r\nSELECT \r\n    * \r\nFROM \r\n    earthquake \r\nWHERE \r\n    sample_time > TO_TIMESTAMP('20210821 12:30', 'YYYYMMDD HH24:MI');\r\n<\/pre>\n<p>DB \ud14c\uc774\ube14\uc5d0\ub294 8\uc6d4 \ub370\uc774\ud130\ub9cc \uc800\uc7a5\ub418\uc5b4 \uc788\ub294\ub370, \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/09\/postgresql_timestamp1.png\" alt=\"\" width=\"1099\" height=\"769\" class=\"aligncenter size-full wp-image-11623\" \/><\/p>\n<p>\uadf8\ub9ac\uace0 2021\ub144 8\uc6d4 2\uc77c\uc5d0 \ub300\ud55c \ub370\uc774\ud130\ub9cc\uc744 \ubf51\uace0\uc790 \ud560\ub54c\uc758 \ucffc\ub9ac \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">\r\nSELECT \r\n    *\r\nFROM \r\n    weather \r\nWHERE \r\n    weather_station_id = 170 AND sample_time::DATE = TO_TIMESTAMP('20210802', 'YYYYMMDD');\r\n<\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc558\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/09\/postgresql_timestamp2.png\" alt=\"\" width=\"684\" height=\"672\" class=\"aligncenter size-full wp-image-11626\" \/><\/p>\n<p>\ub9c8\uc9c0\ub9c9\uc73c\ub85c \uc77c\uc790\ubcc4\ub85c \ud3c9\uade0\uc744 \ub0b4\uae30 \uc704\ud55c \ucffc\ub9ac\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">\r\nSELECT \r\n    sample_time::DATE, AVG(rainfall), AVG(humidity), AVG(ground_heat)\r\nFROM \r\n    weather \r\nWHERE \r\n    weather_station_id = 170 \r\nGROUP BY \r\n    sample_time::DATE \r\nORDER BY \r\n    sample_time::DATE;\r\n<\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/09\/postgresql_timestamp3.png\" alt=\"\" width=\"564\" height=\"844\" class=\"aligncenter size-full wp-image-11627\" \/><\/p>\n<p>\ub367\ubd99\uc5ec TIMESTAMP \ud0c0\uc785\uc758 \ub370\uc774\ud130 \uac12\uc744 \ubb38\uc790\uc5f4\ub85c \ubcc0\ud658\ud558\uae30 \uc704\ud574\uc11c\ub294 TO_CHAR\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud65c\uc6a9 \uc608\ub85c 2025\ub144 4\uc6d4\uc5d0 \ub300\ud55c \ucffc\ub9ac\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">\r\nSELECT \r\n    *\r\nFROM \r\n    project \r\nWHERE \r\n    TO_CHAR(date_modified, 'YYYYMM') = '202504';\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL\uc5d0\uc11c \ub0a0\uc9dc\uc640 \uc2dc\uac04\uc744 \ud558\ub098\uc758 \ud544\ub4dc\ub85c \uc800\uc7a5\ud560 \uc218 \uc788\ub294 \ud0c0\uc785\uc740 Timestamp\uc785\ub2c8\ub2e4. \ud504\ub85c\uc81d\ud2b8\ub97c \uc9c4\ud589\ud558\uba74\uc11c \uc774 TimeStamp\uc5d0 \ub300\ud55c \ucffc\ub9ac\uc5d0 \ub300\ud574 \uc815\ub9ac\ud574 \ubcf4\uace0\uc790 \ud569\ub2c8\ub2e4. \uc0ac\uc6a9\ud55c \ud14c\uc774\ube14\uc740 \uc5ec\ub7ec\ubd84\uacfc \ub2e4\ub97c \uc218 \uc788\uc73c\ub2c8 \ucffc\ub9ac \uacb0\uacfc\uc5d0 \ub300\ud574\uc11c\ub294 \uc720\uc5f0\ud558\uac8c \ucc38\uace0\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4. \uadf8\ub9ac\uace0 Timestamp \ud0c0\uc785\uc758 \ud544\ub4dc\ub294 sample_time\uc785\ub2c8\ub2e4. \uba3c\uc800 2021\ub144 8\uc6d4 21\uc77c 12\uc2dc 30\ubd84 \uc774\ud6c4\uc5d0 \ubc1c\uc0dd\ud55c \ub370\uc774\ud130\ub97c \uc5bb\uc5b4\uc624\uae30 \uc704\ud55c \ucffc\ub9ac\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. SELECT * FROM &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=11622\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;PostgreSQL\uc758 TimeStamp \ud0c0\uc785\uc5d0 \ub300\ud55c \ucffc\ub9ac&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-11622","post","type-post","status-publish","format-standard","hentry","category-gisdev"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11622"}],"version-history":[{"count":7,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11622\/revisions"}],"predecessor-version":[{"id":15911,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11622\/revisions\/15911"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11622"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}