{"id":161359,"date":"2020-09-10T06:27:07","date_gmt":"2020-09-09T22:27:07","guid":{"rendered":"http:\/\/4563.org\/?p=161359"},"modified":"2020-09-10T06:27:07","modified_gmt":"2020-09-09T22:27:07","slug":"select-%e6%97%a7%e8%a1%a8%e5%86%85%e5%ae%b9%ef%bc%8c-insert-%e5%88%b0%e6%96%b0%e8%a1%a8%ef%bc%8c%e5%a6%82%e4%bd%95%e5%bf%bd%e7%95%a5id%e5%ad%97%e6%ae%b5%e6%af%94%e8%be%83%e7%a7%91%e5%ad%a6%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=161359","title":{"rendered":"SELECT \u65e7\u8868\u5185\u5bb9\uff0c INSERT \u5230\u65b0\u8868\uff0c\u5982\u4f55\u5ffd\u7565`id`\u5b57\u6bb5\u6bd4\u8f83\u79d1\u5b66\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  SELECT \u65e7\u8868\u5185\u5bb9\uff0c INSERT \u5230\u65b0\u8868\uff0c\u5982\u4f55\u5ffd\u7565`id`\u5b57\u6bb5\u6bd4\u8f83\u79d1\u5b66\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qazwsxkevin <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u60f3\u628a\u65e7\u8868\u7684\u4e00\u4e9b\u5185\u5bb9\uff0c\u63d2\u5165\u5230\u65b0\u8868\uff0c\u7528\u4e86*\u7684\u8bdd\uff0c\u4f1a\u628a\u65e7\u8868\u7684 id \u53f7\u4e5f\u5e26\u8fc7\u53bb\u4e86 <br \/>\uff08\u5b57\u6bb5\u6bd4\u8f83\u591a\uff09 <\/p>\n<p>\u6211\u80fd\u60f3\u5230\u7684\u662f <br \/>\u5148\u6839\u636e oldtbl \u7ed3\u6784\u521b\u5efa\u4e00\u4e2a tmptbl <br \/>INSERT INTO temptbl SELECT * FROM oldtbl WHERE XX=XX; <br \/>\u5148\u628a\u4e1c\u897f\u653e\u5230\u5230\u4e34\u65f6\u8868 <br \/>\u5bf9 temptbl \u8fdb\u884c\u5220\u9664 id \u5217 <br \/>\u518d\u628a temptbl \u7684\u5185\u5bb9 SELECT *\u63d2\u5165\u5230 newtbl <\/p>\n<p>\u5982\u679c\u662f\u5728\u7a0b\u5e8f\u8bbe\u8ba1\u90e8\u5206\uff0c\u7a0d\u5fae\u590d\u6742\u4e9b\uff0c\u6211\u5148\u628a\u8868\u7ed3\u6784\u8bfb\u4e86\u51fa\u6765\uff0c\u5efa tmptbl\uff0c\u7136\u540e\u7ec4\u88c5\u5b57\u6bb5\u6bb5\uff0cValue \u6bb5\uff0c\u907f\u5f00`id`,\u4e00\u6761 SQL \u64b8\u5b8c <br \/>\u800c SQL \u672c\u8eab\u7684\u8bed\u6cd5\u8bbe\u8ba1\uff0c\u4f3c\u4e4e\u6ca1\u6709\u5ffd\u7565\u5b57\u6bb5\u8fd9\u6837\u64cd\u4f5c\uff1f      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3483834\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RedBeanIce <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u4e2a\u8868\u4e09\u4e2a\u5b57\u6bb5\uff0cid, username, password<br \/>\u4e0d\u5199*\uff0c\u5199\u4e09\u4e2a\u5b57\u6bb5<\/p>\n<p>\u7136\u540e<br \/>&#8216;null&#8217;, &#8216;username&#8217;, &#8216;password&#8217;<\/p>\n<p>\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u79cd<br \/>insert into sys_userinfo (id, userCode, username, password)<br \/>select null, 123456, &#8216;username&#8217;, &#8216;password&#8217;<br \/>from t_product;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3483835\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tydl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             navicat \u5de5\u5177<br \/>1.\u5bfc\u51fa\u539f\u8868\u7684 excel<br \/>2.\u7528 excel \u6253\u5f00\uff0c\u5220\u9664 id \u5217<br \/>3.\u5bfc\u5165 excel \u8ffd\u52a0\u65b0\u8868\u91cc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3483836\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : levelworm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5443\uff0c\u53ef\u80fd\u6211\u7406\u89e3\u9519\u4e86\uff0c\u4f46\u662f datagrip \u53ef\u4ee5\u76f4\u63a5\u5c55\u5f00\u6240\u6709\u5b57\u6bb5\uff1f\u7136\u540e\u5220\u9664 id \u5c31\u597d\u4e86\u5427\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3483837\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hooopo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             select *, null as id                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3483838\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhangysh1995 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             create table t select a, b, c from oldtbl.<\/p>\n<p>https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/create-table-select.html                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>SELECT \u65e7\u8868\u5185\u5bb9\uff0c INSE&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/161359"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161359"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/161359\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161359"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}