Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Hariharan .

Asked: May 01, 2020 - 9:14 am UTC

Last updated: May 05, 2020 - 1:48 am UTC

Version: 2018

Viewed 1000+ times

You Asked

Hi Tom,

I have a table with 5000 columns which includes columns of different data types, Say 1000 columns of int type, 1000 columns of string type, 1000 columns of float type and so on.
Now my question is to write a query to trim only those string columns say like 3000 columns and its respective records.

Else we can trim all 5000 at once and i can change all other int columns using cast after trimming.

Please help me to solve this.
Thanks in advance

and Connor said...

I'm very impressed you have a table with 5000 columns because .........

SQL> create table t ( c1 int 
  2         c2 int,
  3         c3 int,
 ....
....
1001    c1001 int );

ERROR at line 1:
ORA-01792: maximum number of columns in a table or view is 1000


So.... I'm not sure what your question is here.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Design

New to good database design? Check out Chris Saxon's full fundamentals class.