如何使用select语句插入数据...
我遇到了一个问题,select * from orders;是用来做什么的?答案是为了查看和插入...
请提供一个解释...
发布于 2010-11-08 22:30:58
发布于 2010-11-08 22:26:36
要根据select插入值,请使用以下语法:
insert into table1 (mycol)
select mycol from table2您还可以使用允许您创建新表的select into:select into
select * from table1表示从table1中选择每一列
有关SQL的完整教程,请尝试使用W3schools。
发布于 2010-11-08 22:33:40
您可以使用
insert into tableX(columnsX) select columnsY from tableY
若要将数据从tableY插入到tableX,请执行以下操作。它们可以是相同的。columnsY是tableY中存在的列的列表,它必须与tableY中的列类型匹配。
这基本上意味着您将把现有数据插入到tableX中,并且现有数据来自tableY。
对于这个问题,
"what is "select * from orders ;" used for?"
答案
for viewing and inserting
是不正确的。它只用于查看,而不是插入。
https://stackoverflow.com/questions/4124706
复制相似问题