{"id":791,"date":"2021-07-08T08:07:04","date_gmt":"2021-07-08T08:07:04","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=791"},"modified":"2021-07-08T08:27:32","modified_gmt":"2021-07-08T08:27:32","slug":"vstroennye-funkczii","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/vstroennye-funkczii\/","title":{"rendered":"\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 MySQL \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0440\u044f\u0434 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>CONCAT<\/strong>: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0442 2-\u0445 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c:1<code>SELECT<\/code> <code>CONCAT(<\/code><code>'Tom'<\/code><code>, <\/code><code>' '<\/code><code>, <\/code><code>'Smith'<\/code><code>)&nbsp; <\/code><code>-- Tom Smith<\/code>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u043e \u0438 \u0447\u0438\u0441\u043b\u0430, \u0434\u0430\u0442\u044b &#8211; \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f.<\/li><li><strong>CONCAT_WS<\/strong>: \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438:1<code>SELECT<\/code> <code>CONCAT_WS(<\/code><code>' '<\/code><code>, <\/code><code>'Tom'<\/code><code>, <\/code><code>'Smith'<\/code><code>, <\/code><code>'Age:'<\/code><code>, 34)&nbsp; <\/code><code>-- Tom Smith Age: 34<\/code><\/li><li><strong>LENGTH<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0434\u043e \u043d\u0430\u0439\u0442\u0438 \u0434\u043b\u0438\u043d\u0443:1<code>SELECT<\/code> <code>LENGTH(<\/code><code>'Tom Smith'<\/code><code>)&nbsp; <\/code><code>-- 9<\/code><\/li><li><strong>LTRIM<\/strong>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443:1<code>SELECT<\/code> <code>LTRIM(<\/code><code>'&nbsp; Apple'<\/code><code>)<\/code><\/li><li><strong>RTRIM<\/strong>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443:1<code>SELECT<\/code> <code>RTRIM(<\/code><code>' Apple&nbsp;&nbsp;&nbsp; '<\/code><code>)<\/code><\/li><li><strong>TRIM<\/strong>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443:1<code>SELECT<\/code> <code>TRIM(<\/code><code>'&nbsp; Tom Smith&nbsp;&nbsp; '<\/code><code>)<\/code>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0433\u0434\u0435 \u0438\u043c\u0435\u0435\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b:&nbsp;<code>BOTH<\/code>&nbsp;(\u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435),&nbsp;<code>TRAILING<\/code>&nbsp;(\u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043d\u0446\u0435),&nbsp;<code>LEADING<\/code>&nbsp;(\u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435):1<code>SELECT<\/code> <code>TRIM(BOTH <\/code><code>FROM<\/code> <code>'&nbsp; Tom Smith&nbsp;&nbsp; '<\/code><code>)<\/code><\/li><li><strong>LOCATE(find, search [, start])<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 find \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 search. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 start \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 search, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 find. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 search \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f 0:1234<code>SELECT<\/code> <code>LOCATE(<\/code><code>'om'<\/code><code>, <\/code><code>'Tom Smith'<\/code><code>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- 2<\/code><code>SELECT<\/code> <code>LOCATE(<\/code><code>'m'<\/code><code>, <\/code><code>'Tom Smith'<\/code><code>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- 3<\/code><code>SELECT<\/code> <code>LOCATE(<\/code><code>'m'<\/code><code>, <\/code><code>'Tom Smith'<\/code><code>, 4);&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- 6<\/code><code>SELECT<\/code> <code>LOCATE(<\/code><code>'mig'<\/code><code>, <\/code><code>'Tom Smith'<\/code><code>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- 0<\/code><\/li><li><strong>LEFT<\/strong>: \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u0442 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8211; \u0441\u0442\u0440\u043e\u043a\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 &#8211; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0438:1<code>SELECT<\/code> <code>LEFT<\/code><code>(<\/code><code>'Apple'<\/code><code>, 3) <\/code><code>-- App<\/code><\/li><li><strong>RIGHT<\/strong>: \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u0442 \u0441 \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8211; \u0441\u0442\u0440\u043e\u043a\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 &#8211; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0438:1<code>SELECT<\/code> <code>RIGHT<\/code><code>(<\/code><code>'Apple'<\/code><code>, 3)&nbsp;&nbsp;&nbsp; <\/code><code>-- ple<\/code><\/li><li><strong>SUBSTRING(str, start [, length])<\/strong>: \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 str \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 start. \u0422\u0440\u0435\u0442\u0438\u0439 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432:12<code>SELECT<\/code> <code>SUBSTRING<\/code><code>(<\/code><code>'Galaxy S8 Plus'<\/code><code>, 8),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- S8 Plus<\/code><code>(<\/code><code>SELECT<\/code> <code>SUBSTRING<\/code><code>(<\/code><code>'Galaxy S8 Plus'<\/code><code>, 8, 2) );&nbsp;&nbsp;&nbsp; <\/code><code>-- S8<\/code><\/li><li><strong>SUBSTRING_INDEX(str, delimiter, count)<\/strong>: \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 str \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 delimiter \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438. \u0410 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 count \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0434\u043e \u043a\u0430\u043a\u043e\u0433\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u043d\u0430\u0434\u043e \u0432\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443. \u0415\u0441\u043b\u0438 count \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0447\u0430\u043b\u0430, \u0435\u0441\u043b\u0438 count \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u0442\u043e \u0441 \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 str:123<code>SELECT<\/code> <code>SUBSTRING_INDEX(<\/code><code>'Galaxy S8 Plus'<\/code><code>, <\/code><code>' '<\/code><code>, 1),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- Galaxy<\/code><code>(<\/code><code>SELECT<\/code> <code>SUBSTRING_INDEX(<\/code><code>'Galaxy S8 Plus'<\/code><code>, <\/code><code>' '<\/code><code>, 2) ),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- Galaxy S8<\/code><code>(<\/code><code>SELECT<\/code> <code>SUBSTRING_INDEX(<\/code><code>'Galaxy S8 Plus'<\/code><code>, <\/code><code>' '<\/code><code>, -2) );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/code><code>-- S8 Plus<\/code><\/li><li><strong>REPLACE(search, find, replace)<\/strong>: \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 find \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443 search \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443 replace. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8211; \u0441\u0442\u0440\u043e\u043a\u0430, \u0432\u0442\u043e\u0440\u043e\u0439 &#8211; \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u0430 \u0442\u0440\u0435\u0442\u0438\u0439 &#8211; \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c:1<code>SELECT<\/code> <code>REPLACE<\/code><code>(<\/code><code>'Galaxy S8 Plus'<\/code><code>, <\/code><code>'S8 Plus'<\/code><code>, <\/code><code>'Note 8'<\/code><code>)&nbsp;&nbsp; <\/code><code>-- Galaxy Note 8<\/code><\/li><li><strong>INSERT(str, start, length, insert)<\/strong>: \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 str, \u0437\u0430\u043c\u0435\u043d\u044f\u044f length \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 start \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u043e\u0439 insert. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8211; \u0441\u0442\u0440\u043e\u043a\u0430, \u0432\u0442\u043e\u0440\u043e\u0439 &#8211; \u043f\u043e\u0437\u0438\u0446\u0438\u044f, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u0442\u0440\u0435\u0442\u0438\u0439 &#8211; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 start \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8211; \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430:1<code>SELECT<\/code> <code>INSERT<\/code><code>(<\/code><code>'Galaxy S9'<\/code><code>, 8, 3, <\/code><code>'Note 9'<\/code><code>);&nbsp;&nbsp; <\/code><code>-- Galaxy Note 9<\/code><\/li><li><strong>REVERSE<\/strong>: \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442:1<code>SELECT<\/code> <code>REVERSE(<\/code><code>'123456789'<\/code><code>) <\/code><code>-- 987654321<\/code><\/li><li><strong>LOWER<\/strong>: \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440:1<code>SELECT<\/code> <code>LOWER<\/code><code>(<\/code><code>'Apple'<\/code><code>)&nbsp;&nbsp; <\/code><code>-- apple<\/code><\/li><li><strong>UPPER<\/strong>: \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u04401<code>SELECT<\/code> <code>UPPER<\/code><code>(<\/code><code>'Apple'<\/code><code>)&nbsp;&nbsp; <\/code><code>-- APPLE<\/code><\/li><li><strong>SPACE<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432<\/li><li><strong>REPEATE(str, count)<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u0432 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 str. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u0432 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 count.1<code>SELECT<\/code> <code>REPEAT(<\/code><code>'ab'<\/code><code>, 5);&nbsp;&nbsp; <\/code><code>-- ababababab<\/code><\/li><li><strong>LPAD(str, length, pad)<\/strong>: \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 str \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 pad. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435&nbsp;<code>length - LENGTH(str)<\/code>. \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 length \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 str, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0443\u0441\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0434\u043e length \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.1<code>SELECT<\/code> <code>LPAD(<\/code><code>'Tom Smith'<\/code><code>, 13, <\/code><code>'*'<\/code><code>);&nbsp;&nbsp; <\/code><code>-- ****Tom Smith<\/code><\/li><li><strong>RPAD(str, length, pad)<\/strong>: \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 str \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 pad. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435&nbsp;<code>length - LENGTH(str)<\/code>. \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 length \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 str, \u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0443\u0441\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0434\u043e length \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.1<code>SELECT<\/code> <code>RPAD(<\/code><code>'Tom Smith'<\/code><code>, 13, <\/code><code>'*'<\/code><code>);&nbsp;&nbsp; <\/code><code>-- Tom Smith****<\/code><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<\/td><td><code>CREATE<\/code> <code>TABLE<\/code> <code>Products<\/code><br><code>(<\/code><br><code>Id INT<\/code> <code>AUTO_INCREMENT PRIMARY<\/code> <code>KEY,<\/code><br><code>ProductName VARCHAR(30) NOT<\/code> <code>NULL,<\/code><br><code>Manufacturer VARCHAR(20) NOT<\/code> <code>NULL,<\/code><br><code>ProductCount INT<\/code> <code>DEFAULT<\/code> <code>0,<\/code><br><code>Price DECIMAL<\/code> <code>NOT<\/code> <code>NULL<\/code><br><code>);<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418 \u043f\u0440\u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<\/td><td><code>SELECT<\/code> <code>UPPER(LEFT(Manufacturer,2)) AS<\/code> <code>Abbreviation,<\/code><br>                        <code>CONCAT(ProductName, ' - ',&nbsp; Manufacturer) AS<\/code> <code>FullProdName<\/code><br><code>FROM<\/code> <code>Products<\/code><br><code>ORDER<\/code> <code>BY<\/code> <code>Abbreviation<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/metanit.com\/sql\/mysql\/pics\/8.1.png\" alt=\"\u0421\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 MySQL\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 MySQL \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0440\u044f\u0434 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: CONCAT: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[75],"tags":[],"class_list":["post-791","page","type-page","status-publish","hentry","category-rukovodstvo-po-mysql"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=791"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/791\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}