ÏòÒ»Õűí²åÈëÊý¾Ý,ÆäÖÐÒ»¸ö×ֶεÄÖµÀ´×Ôselect ²éѯ³öÀ´µÄ¼¯ºÏ¡£ Èç: insert into table1(id,name,pwd)values(1,'name','123') ÆäÖÐnameÖµ¾ÍÊÇselect²éѯ³öÀ´µÄ¼¯ºÏÖÐÆäÖÐÒ»¸öÖµ£¬ÀýÈ磺select name from talbe2;
ÇëÎÊÍøÓÑÃÇ£¬ÕâÖÖÐèÇóµÄSQLÓï¾äÔõôд£¿
SQL code: insert into table1(id,name,pwd) SELECT 1,name,'123' from TABLE2
insert into table1(id,name,pwd) select 1,name,'123' from table2 SQL code: insert into table1(id,name,pwd)select '1',name,'123' from table2
SQL code:
insert into table1(name)
select name from table2
ÆäÓàÁÐÃ÷×Ô¼º¼Ó¡£ÏàӦλÖþͿÉÒÔÁË¡£ ÕâÑùÖ»ÊDzåÈëname¼¯ºÏÀïÃæµÄµÚÒ»¸öÖµ£¬¸úÂ¥Ö÷˵µÄ¡®ÆäÖÐÒ»¸öÖµ¡¯Óеã³öÈë insert into table1(name)select name from table2
SQL code: insert into table1(id,name,pwd) SELECT 1,name,'123' from TABLE