簡體   English   中英

排除紅移光譜 sql 查詢中的列

[英]Exclude column in redshift spectrum sql queries

在我的表中有列 col1,col2 .....coln

我想要

select all columns except col1

而不是寫 select col2,col3.... coln from 我可以指定

select * from <table name> except col1

Select 除一列外的所有列

你可以做這樣的事情-

-- create a temporary copy of your table
SELECT * INTO temp_table FROM original_table;

-- drop the column you don't need
ALTER TABLE temp_table DROP COLUMN col1;

-- select all columns
SELECT * FROM temp_table;

-- drop the temporary table
DROP TABLE temp_table;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM