如何使用SqlServer 2005中的Query将现有表列数据复制到新表中 [英] How to copy Existing table column data into New table using Query in SqlServer 2005
问题描述
朋友们,祝你有个美好的一天。
我正在使用SqlServer 2005数据库。我需要查询。请帮忙。
我有表名与问题,在这个问题DB我有字段作为QCode和QDescription ...在这个表中我有近50个问题。现在我需要使用QuestionCode将一些选定的问题复制到新表中。
例如,Qcode是101,QDescription是期望工资。
所以,我需要将一些选定的问题复制到新表中。
我为此写了一个查询
从问题中选择*进入NewTable,其中Qcode = 101.
通过此查询,我可以复制一行。
我的问题是我需要使用查询在新表中复制近10个问题。
请帮忙。
谢谢。
Hello Friends, Have a Good Day.
am Working on SqlServer 2005 Database. I need Query. Please help.
I have table Name with Questions, In this Questions DB I have Fields as QCode and QDescription...In this table I have almost 50 Questions. and Now I need to Copy some Selected Questions into New Table using QuestionCode.
For Example the Qcode is 101 and the QDescription is Expectation of Salary.
So, I need to copy some selected Questions into the NEW Table.
I Wrote one Query for this
Select * into NewTable from Questions where Qcode=101.
With this query I can Copy one one Row.
my problem is I need to Copy almost 10 Questions in New Table using Query.
Please help.
Thanks.
推荐答案
http://stackoverflow.com/questions/8070097/copy-column-into-existing-table-using- sql [ ^ ]
您好,
使用此
Hi,
use this
Select * into NewTable from Questions where Qcode in (101,102,..)
这篇关于如何使用SqlServer 2005中的Query将现有表列数据复制到新表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!