{"height":"190","url":"https://htn20190109.hatenablog.com/entry/2021/07/12/214104","type":"rich","categories":["DB"],"width":"100%","blog_url":"https://htn20190109.hatenablog.com/","provider_url":"https://hatena.blog","author_name":"HTN20190109","title":"\u30bb\u30c3\u30b7\u30e7\u30f3\u3067\u6700\u5f8c\u306b\u751f\u6210\u3057\u305fID\u5024\u306e\u53d6\u5f97","published":"2021-07-12 21:41:04","blog_title":"HTN20190109\u306e\u65e5\u8a18","description":"MySQL (8.0.22) LAST_INSERT_ID()\u2192\u6700\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u305fINSERT\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u7d50\u679c\u3068\u3057\u3066AUTO_INCREMENT\u30ab\u30e9\u30e0\u306b\u6b63\u5e38\u306b\u633f\u5165\u3055\u308c\u305f\u6700\u521d\u306e\u81ea\u52d5\u751f\u6210\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002 drop table tab1;create table tab1(col1 int not null auto_increment primary key,col2 int); insert into tab1(col2) values(10); select * from tab1;select LAST_INSERT_ID(); Oracle (19c) drop sequence seq1\u2026","image_url":null,"version":"1.0","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/HTN20190109/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhtn20190109.hatenablog.com%2Fentry%2F2021%2F07%2F12%2F214104\" title=\"\u30bb\u30c3\u30b7\u30e7\u30f3\u3067\u6700\u5f8c\u306b\u751f\u6210\u3057\u305fID\u5024\u306e\u53d6\u5f97 - HTN20190109\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}