{"id":937,"date":"2024-08-26T13:15:24","date_gmt":"2024-08-26T10:15:24","guid":{"rendered":"https:\/\/aristov.tech\/blog\/?p=937"},"modified":"2024-10-07T15:00:23","modified_gmt":"2024-10-07T12:00:23","slug":"select-v-postgresql","status":"publish","type":"post","link":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/","title":{"rendered":"SELECT \u0432 PostgreSQL"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430\u00a0<a href=\"https:\/\/youtu.be\/zjiye4UGl9w\">14 \u0432\u0438\u0434\u0435\u043e<\/a>\u00a0\u0438\u0437 30 \u0442\u0435\u043c\u00a0<a href=\"https:\/\/aristov.tech\/blog\/kurs-sql-c-0\/\">\u043a\u0443\u0440\u0441\u0430 SQL c 0<\/a>\u00a0\u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 <a href=\"https:\/\/rutube.ru\/video\/394d91b26346d8136d7f796f56343d6b\/\">RUTUBE<\/a> \u0438 <a href=\"https:\/\/vk.com\/video-212716752_456239071\">VK \u0432\u0438\u0434\u0435\u043e<\/a>.<\/p>\n\n\n\n<p>\u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 <a href=\"https:\/\/aristov.tech\/blog\/alter-drop-postgresql\/\">\u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 ALTER&amp;DROP \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c.<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>SELECT<\/strong><\/p>\n\n\n\n<p>SELECT \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0411\u0414 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0432 RDBMS \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 80-95% \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 SELECT (\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 INSERT, UPDATE).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/www.postgresql.org\/docs\/current\/sql-select.html\">SELECT<\/a> &#91; ALL | DISTINCT &#91; ON ( expression &#91;, \u2026] ) ] ]\n&nbsp;&nbsp;&nbsp; &#91; * | expression &#91; &#91; AS ] output_name ] &#91;, \u2026] ]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91; FROM from_item &#91;, \u2026] ]<\/code><\/pre>\n\n\n\n<p><em><strong>DISTINCT<\/strong><\/em> &#8212; \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 JOIN), \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432 \u043a\u0440\u0430\u0439\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>SELECT INTO<\/strong><\/p>\n\n\n\n<p>\u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043a\u0443\u0434\u0430-\u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f SELECT INTO.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.postgresql.org\/docs\/current\/sql-selectinto.html\">PostgreSQL: Documentation: 16: SELECT INTO<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT &#91; ALL | DISTINCT &#91; ON ( expression &#91;, \u2026] ) ] ]\n&nbsp;&nbsp;&nbsp; * | expression &#91; &#91; AS ] output_name ] &#91;, \u2026]\nINTO &#91; TEMPORARY | TEMP | UNLOGGED] &#91; TABLE ] new_table\n&#91; FROM from_item &#91;, \u2026] ]<\/code><\/pre>\n\n\n\n<p><strong><em>TEMPORARY<\/em><\/strong> &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0441\u0435\u0441\u0441\u0438\u0438)<\/p>\n\n\n\n<p><strong><em>UNLOGGED<\/em><\/strong> &#8212; \u043d\u0435\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043d\u043e <a href=\"https:\/\/www.crunchydata.com\/blog\/postgresl-unlogged-tables\">\u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438<\/a><\/p>\n\n\n\n<p>\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438. \u0411\u0415\u0417 constraint, \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, DEFAULT \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438<\/strong><\/p>\n\n\n\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c * (\u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u043d\u044f\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 <a href=\"https:\/\/www.postgresql.org\/docs\/current\/storage-toast.html\">TOAST<\/a> \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445)<\/li>\n\n\n\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <\/li>\n\n\n\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446 (\u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u0445\u0435\u043c\u044b \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443)<\/li>\n\n\n\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u043b\u0438\u0430\u0441\u044b AS (\u0438\u043c\u0435\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438 \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b)<\/li>\n<\/ul>\n\n\n\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0434\u0436\u0438\u043d\u0430\u0446\u0438\u044f (\u0432\u044b\u0432\u043e\u0434 \u043f\u043e 20-100 \u0441\u0442\u0440\u043e\u043a) &#8212; \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 \u042f\u041f \u0438\u043b\u0438 GUI (DBeaver)<\/li>\n\n\n\n<li>\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/li>\n\n\n\n<li>\u041f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b work_mem &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e (\u043e\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435). \u0412 \u0434\u0440\u0443\u0433\u0438\u0445 \u0421\u0423\u0411\u0414 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b<\/li>\n<\/ul>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/strong><\/p>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0421\u043a\u043b\u0430\u0434:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE warehouse (\n    id serial UNIQUE,\n    name text NOT NULL DEFAULT '',\n    kolvo int NOT NULL DEFAULT 0,\n    price numeric NOT NULL DEFAULT 0.0,\n    salesTime timestamp with time zone NOT NULL DEFAULT current_timestamp, -- UTC\n    salesTime2 timestamp NOT NULL DEFAULT current_timestamp\n);\nINSERT INTO warehouse(name) VALUES \n    ('apple');\nINSERT INTO warehouse(name, price) VALUES \n    ('banana',2.1);<\/code><\/pre>\n\n\n\n<p>\u0412 SELECT \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT 1+1;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"210\" height=\"73\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image.png\" alt=\"\" class=\"wp-image-938\" style=\"width:158px;height:auto\"\/><\/figure>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f * (\u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * \nFROM warehouse;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"849\" height=\"144\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-3.png\" alt=\"\" class=\"wp-image-941\" style=\"width:519px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-3.png 849w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-3-300x51.png 300w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-3-768x130.png 768w\" sizes=\"auto, (max-width: 849px) 100vw, 849px\" \/><\/figure>\n\n\n\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0431\u043e\u0440\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439 (\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT id,name,kolvo,price,salesTime \nFROM warehouse;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"701\" height=\"121\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-2.png\" alt=\"\" class=\"wp-image-940\" style=\"width:550px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-2.png 701w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-2-300x52.png 300w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><\/figure>\n\n\n\n<p>\u041f\u043e\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 (\u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT name,id,kolvo,price,salesTime \nFROM warehouse;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"146\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-4.png\" alt=\"\" class=\"wp-image-942\" style=\"width:525px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-4.png 667w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-4-300x66.png 300w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/figure>\n\n\n\n<p>\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 SELECT \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0438\u043f\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT name,id,kolvo,price,salesTime::date \nFROM warehouse;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"128\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-5.png\" alt=\"\" class=\"wp-image-943\" style=\"width:435px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-5.png 563w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-5-300x68.png 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/figure>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT name,id,kolvo,price,(salesTime + '1 day')::date \nFROM warehouse;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"606\" height=\"115\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-6.png\" alt=\"\" class=\"wp-image-944\" style=\"width:490px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-6.png 606w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-6-300x57.png 300w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0445\u0435\u043c\u0443 \u041f\u0440\u043e\u0434\u0430\u0436\u0438 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0421\u043a\u043b\u0430\u0434 \u0432\u043d\u0443\u0442\u0440\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE SCHEMA sales;\nCREATE TABLE sales.warehouse (\n    id serial UNIQUE,\n    name text NOT NULL DEFAULT '',\n    kolvo int NOT NULL DEFAULT 0,\n    price numeric NOT NULL DEFAULT 0.0,\n    salesTime timestamp with time zone NOT NULL DEFAULT         current_timestamp, -- UTC\n    salesTime2 timestamp NOT NULL DEFAULT current_timestamp\n);<\/code><\/pre>\n\n\n\n<p>\u041d\u0430 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u043e\u043b\u044f, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043b\u0443\u0447\u0448\u0435 \u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>comment on column sales.warehouse.salesTime2 is '\u0414\u0430\u0442\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0438';<\/code><\/pre>\n\n\n\n<p>\u0412\u0441\u0442\u0430\u0432\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>INSERT INTO sales.warehouse(name) VALUES \n    ('apple');\nINSERT INTO sales.warehouse(name, price) VALUES \n    ('banana',2.1);\nINSERT INTO sales.warehouse(name) VALUES \n    ('apple');<\/code><\/pre>\n\n\n\n<p>\u0412\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u043b\u044e \u0432 \u0444\u043e\u0440\u043c\u0435 &#171;\u0441\u0445\u0435\u043c\u0430.\u0442\u0430\u0431\u043b\u0438\u0446\u0430.\u043f\u043e\u043b\u0435&#187;, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u043d \u043f\u043e\u043b\u0435\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 PostgreSQL \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 &#171;\u0441\u0445\u0435\u043c\u0430.\u0442\u0430\u0431\u043b\u0438\u0446\u0430&#187;, \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0438\u043c\u044f (ALIAS), \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;w&#187;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT w.name,\nw.id,\nw.kolvo,\nw.price,\n(w.salesTime + '1 day')::date AS nextDay\nFROM sales.warehouse w;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"568\" height=\"129\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-7.png\" alt=\"\" class=\"wp-image-945\" style=\"width:480px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-7.png 568w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-7-300x68.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/figure>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u043d\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u043f\u043e\u043b\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT w.name\n-- ,w.id\n,w.kolvo\n,w.price\n,(w.salesTime + '1 day')::date AS nextDay --\u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043f\u043e\u0441\u043b\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\nFROM sales.warehouse w;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"126\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-8.png\" alt=\"\" class=\"wp-image-946\" style=\"width:385px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-8.png 480w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-8-300x79.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/figure>\n\n\n\n<p>\u0412\u044b\u0431\u043e\u0440 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043c\u0451\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DISTINCT (\u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u0430\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT DISTINCT w.name\nFROM sales.warehouse w;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"172\" height=\"109\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-9.png\" alt=\"\" class=\"wp-image-947\" style=\"width:128px;height:auto\"\/><\/figure>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 w2 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SELECT INTO:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT w.name\n-- ,w.id\n,w.kolvo\n,w.price\n,(w.salesTime + '1 day')::date AS nextDay\nINTO w2\nFROM sales.warehouse w;<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 w2:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * \nFROM w2;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"128\" src=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-10.png\" alt=\"\" class=\"wp-image-948\" style=\"width:380px;height:auto\" srcset=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-10.png 487w, https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image-10-300x79.png 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>\u041f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/github.com\/aeuge\/aristov_tech\/blob\/main\/00%20SQL%20s%200\/presentation\/00%2014%20SQL%20c%200.pdf\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n\n\n\n<p>15 \u0438\u0437 30 \u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u0440\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u2013 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043e\u043d\u043b\u0430\u0439\u043d \u0433\u0440\u0443\u043f\u043f\u0435, \u0441\u0441\u044b\u043b\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432&nbsp;<a href=\"https:\/\/aristov.tech\/blog\/kurs-sql-c-0\/\">\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u0443\u0440\u0441\u0430<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430\u00a014 \u0432\u0438\u0434\u0435\u043e\u00a0\u0438\u0437 30 \u0442\u0435\u043c\u00a0\u043a\u0443\u0440\u0441\u0430 SQL c 0\u00a0\u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 RUTUBE \u0438 VK \u0432\u0438\u0434\u0435\u043e. \u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 ALTER&amp;DROP \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c. SELECT SELECT \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0411\u0414 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0432 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[204,194],"tags":[264,265,16,227,266,263,72,66],"class_list":["post-937","post","type-post","status-publish","format-standard","hentry","category-kurs-sql-s-0","category-obuchenie-postgresql","tag-alias","tag-as","tag-postgresql","tag-select","tag-select-distinct","tag-select-into","tag-kurs","tag-obuchenie"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SELECT \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/aristov.tech\/blog\/select-v-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SELECT \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\" \/>\n<meta property=\"og:description\" content=\"\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430\u00a014 \u0432\u0438\u0434\u0435\u043e\u00a0\u0438\u0437 30 \u0442\u0435\u043c\u00a0\u043a\u0443\u0440\u0441\u0430 SQL c 0\u00a0\u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 RUTUBE \u0438 VK \u0432\u0438\u0434\u0435\u043e. \u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 ALTER&amp;DROP \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c. SELECT SELECT \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0411\u0414 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0432 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/aristov.tech\/blog\/select-v-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-26T10:15:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-07T12:00:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image.png\" \/>\n<meta name=\"author\" content=\"Maria\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"Maria\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u043c\u0438\u043d\u0443\u0442\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/\"},\"author\":{\"name\":\"Maria\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/6a152749a3dde76f19cc30db676d2310\"},\"headline\":\"SELECT \u0432 PostgreSQL\",\"datePublished\":\"2024-08-26T10:15:24+00:00\",\"dateModified\":\"2024-10-07T12:00:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/\"},\"wordCount\":405,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/05f3a04bf720ae4bf25ac99c4248d5e7\"},\"image\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/image.png\",\"keywords\":[\"alias\",\"as\",\"postgresql\",\"select\",\"SELECT DISTINCT\",\"select into\",\"\u043a\u0443\u0440\u0441\",\"\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\"],\"articleSection\":[\"\u041a\u0443\u0440\u0441 SQL \u0441 0\",\"\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 PostgreSQL\"],\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/\",\"name\":\"SELECT \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/image.png\",\"datePublished\":\"2024-08-26T10:15:24+00:00\",\"dateModified\":\"2024-10-07T12:00:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/image.png\",\"contentUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/image.png\",\"width\":210,\"height\":73},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/select-v-postgresql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SELECT \u0432 PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/\",\"name\":\"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/05f3a04bf720ae4bf25ac99c4248d5e7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru-RU\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/05f3a04bf720ae4bf25ac99c4248d5e7\",\"name\":\"admin2\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\",\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\",\"contentUrl\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\",\"width\":180,\"height\":180,\"caption\":\"admin2\"},\"logo\":{\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/blog-logo.png\"},\"sameAs\":[\"https:\\\/\\\/aristov.tech\\\/blog\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/#\\\/schema\\\/person\\\/6a152749a3dde76f19cc30db676d2310\",\"name\":\"Maria\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g\",\"caption\":\"Maria\"},\"url\":\"https:\\\/\\\/aristov.tech\\\/blog\\\/author\\\/maria\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SELECT \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/","og_locale":"ru_RU","og_type":"article","og_title":"SELECT \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","og_description":"\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430\u00a014 \u0432\u0438\u0434\u0435\u043e\u00a0\u0438\u0437 30 \u0442\u0435\u043c\u00a0\u043a\u0443\u0440\u0441\u0430 SQL c 0\u00a0\u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 RUTUBE \u0438 VK \u0432\u0438\u0434\u0435\u043e. \u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 ALTER&amp;DROP \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c. SELECT SELECT \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0411\u0414 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0432 [&hellip;]","og_url":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/","og_site_name":"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","article_published_time":"2024-08-26T10:15:24+00:00","article_modified_time":"2024-10-07T12:00:23+00:00","og_image":[{"url":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image.png","type":"","width":"","height":""}],"author":"Maria","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"Maria","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"5 \u043c\u0438\u043d\u0443\u0442"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/#article","isPartOf":{"@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/"},"author":{"name":"Maria","@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/6a152749a3dde76f19cc30db676d2310"},"headline":"SELECT \u0432 PostgreSQL","datePublished":"2024-08-26T10:15:24+00:00","dateModified":"2024-10-07T12:00:23+00:00","mainEntityOfPage":{"@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/"},"wordCount":405,"commentCount":0,"publisher":{"@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/05f3a04bf720ae4bf25ac99c4248d5e7"},"image":{"@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image.png","keywords":["alias","as","postgresql","select","SELECT DISTINCT","select into","\u043a\u0443\u0440\u0441","\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435"],"articleSection":["\u041a\u0443\u0440\u0441 SQL \u0441 0","\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 PostgreSQL"],"inLanguage":"ru-RU","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/aristov.tech\/blog\/select-v-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/","url":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/","name":"SELECT \u0432 PostgreSQL - \u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","isPartOf":{"@id":"https:\/\/aristov.tech\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/#primaryimage"},"image":{"@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/#primaryimage"},"thumbnailUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image.png","datePublished":"2024-08-26T10:15:24+00:00","dateModified":"2024-10-07T12:00:23+00:00","breadcrumb":{"@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/aristov.tech\/blog\/select-v-postgresql\/"]}]},{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/#primaryimage","url":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image.png","contentUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2024\/07\/image.png","width":210,"height":73},{"@type":"BreadcrumbList","@id":"https:\/\/aristov.tech\/blog\/select-v-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/aristov.tech\/blog\/"},{"@type":"ListItem","position":2,"name":"SELECT \u0432 PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/aristov.tech\/blog\/#website","url":"https:\/\/aristov.tech\/blog\/","name":"\u0411\u043b\u043e\u0433 \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 PostgreSQL \u043e\u0442 \u0410\u0440\u0438\u0441\u0442\u043e\u0432\u0430 \u0415\u0432\u0433\u0435\u043d\u0438\u044f","description":"","publisher":{"@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/05f3a04bf720ae4bf25ac99c4248d5e7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/aristov.tech\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":["Person","Organization"],"@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/05f3a04bf720ae4bf25ac99c4248d5e7","name":"admin2","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png","url":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png","contentUrl":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png","width":180,"height":180,"caption":"admin2"},"logo":{"@id":"https:\/\/aristov.tech\/blog\/wp-content\/uploads\/2023\/05\/blog-logo.png"},"sameAs":["https:\/\/aristov.tech\/blog"]},{"@type":"Person","@id":"https:\/\/aristov.tech\/blog\/#\/schema\/person\/6a152749a3dde76f19cc30db676d2310","name":"Maria","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/secure.gravatar.com\/avatar\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a86c8edd49a73db805cc02e271f5fc126b109c146ad0d8976829c538b3b94ca4?s=96&d=mm&r=g","caption":"Maria"},"url":"https:\/\/aristov.tech\/blog\/author\/maria\/"}]}},"_links":{"self":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts\/937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/comments?post=937"}],"version-history":[{"count":6,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions"}],"predecessor-version":[{"id":1387,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions\/1387"}],"wp:attachment":[{"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/media?parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/categories?post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aristov.tech\/blog\/wp-json\/wp\/v2\/tags?post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}