[英]Exclude column in redshift spectrum sql queries
In my table having columns col1,col2.....coln在我的表中有列 col1,col2 .....coln
I want to我想要
select all columns except col1
instead of writing select col2,col3.... coln from I can specify而不是写 select col2,col3.... coln from 我可以指定
select * from <table name> except col1
Select all column excluding one column Select 除一列外的所有列
You can do something like this-你可以做这样的事情-
-- 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.