How to select all the columns of a table except one column?

前端 未结 13 2397
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 05:43

How to select all the columns of a table except one column?

I have nearly 259 columns I cant mention 258 columns in SELECT statement.

Is there

相关标签:
13条回答
  • 2020-12-14 06:19

    This is not a generic solution, but some databases allow you to use regular expressions to specify the columns.

    For instance, in the case of Hive, the following query selects all columns except ds and hr:

    SELECT `(ds|hr)?+.+` FROM sales
    

    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select#LanguageManualSelect-REGEXColumnSpecification

    0 讨论(0)
提交回复
热议问题