{"id":370,"date":"2005-05-05T01:00:00","date_gmt":"2005-05-04T16:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2005-05-05-1.html"},"modified":"2026-08-10T14:34:31","modified_gmt":"2026-08-10T05:34:31","slug":"2005-05-05-1","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2005-05-05-1.html","title":{"rendered":"\u6700\u5f8c\u306b\u633f\u5165\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u306e\u4e00\u610f\u306a ID \u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p>\n&#8211; LAST_INSERT_ID() \u3092\u4f7f\u3046\u3068\u3088\u3044\u3002<\/p>\n<blockquote><p>INSERT INTO user_list (id,name) values (555, &#8220;foo&#8221;);<br \/>\nSELECT LAST_INSERT_ID();<br \/>\n&nbsp;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br \/>\n&nbsp;| LAST_INSERT_ID() |<br \/>\n&nbsp;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br \/>\n&nbsp;|              555 |<br \/>\n&nbsp;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+\n<\/p><\/blockquote>\n<p>\u3068\u3044\u3046\u611f\u3058\u3002\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u5358\u4f4d\u3067\u4fdd\u6301\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u540c\u6642\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u3066\u3082\u5e72\u6e09\u3057\u306a\u3044\u3002\u305f\u3060\u3057\u3001\u53d6\u5f97\u3059\u308b ID \u306f AUTO_INCREMENT \u3067\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<br \/>\nhttp:\/\/dev.mysql.com\/doc\/mysql\/ja\/getting-unique-id.html<br \/>\n&#8211; MySQL \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb :: 11.1.12.3 \u6700\u5f8c\u306b\u633f\u5165\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u306e\u4e00\u610f\u306a ID \u306f\u3069\u306e\u3088\u3046\u306b\u53d6\u5f97\u3059\u308b\u306e\u304b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8211; LAST_INSERT_ID() \u3092\u4f7f\u3046\u3068\u3088\u3044\u3002 INSERT INTO user_list (id,name) values (555, &#8220;foo&#8221;); SELECT LAST_ &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2005-05-05-1.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u6700\u5f8c\u306b\u633f\u5165\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u306e\u4e00\u610f\u306a ID \u3092\u53d6\u5f97\u3059\u308b<\/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":[141],"tags":[26],"class_list":["post-370","post","type-post","status-publish","format-standard","hentry","category-lifehack","tag-mysql"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=370"}],"version-history":[{"count":1,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/370\/revisions"}],"predecessor-version":[{"id":1504,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/370\/revisions\/1504"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}