如何选择表格中除一列之外的所有列? [英] How to select all the columns of a table except one column?
本文介绍了如何选择表格中除一列之外的所有列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何选择表格中除一列之外的所有列?
How to select all the columns of a table except one column?
我有将近 259 列我不能在 SELECT
语句中提到 258 列.
I have nearly 259 columns I cant mention 258 columns in SELECT
statement.
还有其他方法吗?
推荐答案
您可以使用此方法从除一列之外的所有列中获取数据:-
You can use this approach to get the data from all the columns except one:-
- 将所有数据插入临时表
- 然后从临时表中删除不需要的列
- 从临时表中获取数据(这将不包含删除列的数据)
- 删除临时表
像这样:
SELECT * INTO #TemporaryTable FROM YourTableName
ALTER TABLE #TemporaryTable DROP COLUMN Columnwhichyouwanttoremove
SELECT * FROM #TemporaryTable
DROP TABLE #TemporaryTable
这篇关于如何选择表格中除一列之外的所有列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文