forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
32 lines
4.2 KiB
HTML
32 lines
4.2 KiB
HTML
<a name="EN-US_TOPIC_0000001772696248"></a><a name="EN-US_TOPIC_0000001772696248"></a>
|
|
|
|
<h1 class="topictitle1">VALUES</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001772696248__en-us_topic_0000001657865218_en-us_topic_0000001437787225_en-us_topic_0214164526_p583023710322">MySQL REPLACE supports a statement to insert or delete multiple values, separated by commas.</p>
|
|
<p id="EN-US_TOPIC_0000001772696248__en-us_topic_0000001657865218_en-us_topic_0000001437787225_en-us_topic_0214164526_p8060118"><strong id="EN-US_TOPIC_0000001772696248__en-us_topic_0000001657865218_en-us_topic_0000001437787225_en-us_topic_0214164526_b194316247614">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001772696248__en-us_topic_0000001657865218_en-us_topic_0000001437787225_en-us_topic_0214164526_screen1378217271865"># If data is available, replacement will be performed. Otherwise, insertion will be performed.
|
|
Replace INTO exmp_tb1 (tb1_id,tb1_name,tb1_sex,tb1_address,tb1_number) VALUES(17,'David','male','NewYork11','01015827875'),(18,'Rachel','female','NewYork22','01015827749'),(20,'Monica','female','NewYork','010158996743');
|
|
Replace INTO exmp_tb1 (tb1_id,tb1_name,tb1_sex,tb1_address,tb1_number) VALUES(17,'David1','male','NewYork11','01015827875'),(21,'Rachel','female','NewYork22','01015827749'),(22,'Monica','female','NewYork','010158996743');
|
|
Replace INTO exmp_tb1 (tb1_id,tb1_name,tb1_sex,tb1_address,tb1_number,tb1_date) VALUES(17,'David2',DEFAULT,'NewYork11','01015827875',DEFAULT),(18,'Rachel','female',DEFAULT,'01015827749','2018-12-14 10:44:20'),(DEFAULT,'Monica','female',DEFAULT,DEFAULT,'2018-12-14 10:44:20');
|
|
Replace INTO exmp_tb1 VALUES(DEFAULT,'David',DEFAULT,'NewYork11','01015827875',DEFAULT),(18,'Rachel','female',DEFAULT,'01015827749','2018-12-14 10:44:20'),(DEFAULT,'Monica','female',DEFAULT,DEFAULT,'2018-12-14 10:44:20');</pre>
|
|
<p id="EN-US_TOPIC_0000001772696248__en-us_topic_0000001657865218_en-us_topic_0000001437787225_en-us_topic_0214164526_p5839501968"><strong id="EN-US_TOPIC_0000001772696248__en-us_topic_0000001657865218_en-us_topic_0000001437787225_en-us_topic_0214164526_b1639915813618">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001772696248__en-us_topic_0000001657865218_en-us_topic_0000001437787225_en-us_topic_0214164526_screen17365131977">-- If data is available, replacement will be performed. Otherwise, insertion will be performed.
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number") VALUES (17,'David','male','NewYork11','01015827875');
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number") VALUES (18,'Rachel','female','NewYork22','01015827749');
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number") VALUES (20,'Monica','female','NewYork','010158996743');
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number") VALUES (17,'David1','male','NewYork11','01015827875');
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number") VALUES (21,'Rachel','female','NewYork22','01015827749');
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number") VALUES (22,'Monica','female','NewYork','010158996743');
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number","tb1_date") VALUES (17,'David2',DEFAULT,'NewYork11','01015827875',DEFAULT);
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number","tb1_date") VALUES (18,'Rachel','female',DEFAULT,'01015827749','2018-12-14 10:44:20');
|
|
INSERT INTO "public"."exmp_tb1" ("tb1_id","tb1_name","tb1_sex","tb1_address","tb1_number","tb1_date") VALUES (DEFAULT,'Monica','female',DEFAULT,DEFAULT,'2018-12-14 10:44:20');
|
|
INSERT INTO "public"."exmp_tb1" VALUES (DEFAULT,'David',DEFAULT,'NewYork11','01015827875',DEFAULT);
|
|
INSERT INTO "public"."exmp_tb1" VALUES (18,'Rachel','female',DEFAULT,'01015827749','2018-12-14 10:44:20');
|
|
INSERT INTO "public"."exmp_tb1" VALUES (DEFAULT,'Monica','female',DEFAULT,DEFAULT,'2018-12-14 10:44:20');</pre>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0198.html">REPLACE</a></div>
|
|
</div>
|
|
</div>
|
|
|