Home > database >  Don't know which column data, which column without the data, and the table fields more than one
Don't know which column data, which column without the data, and the table fields more than one

Time:09-17


To store huge amounts of data in a table, I just want to check with the data of field how to write the oracle SQL statement
The drawing red three have data, no mark is no data,
If you don't know which column data, which column without the data, and the table fields more than one hundred, how to write SQL is more effective?

CodePudding user response:

If the data is static, and you said that the field is empty refers to all the lines of a field is null, consider saving curve:
To collect all field statistics, such as: exec dbms_stats. Gather_table_stats (user, 'T', cascade=& gt; True, degree=& gt; 8, method_opt=& gt; 'for all the columns');
Then check out two data dictionary: user_tables and user_tab_col_statistics, if user_tab_col_statistics NUM_NULLS fields and user_tables. NUM_ROWS are equal, then the user_tab_col_statistics. COLUMN_NAME corresponding field is not insert data, that means you don't want to see these fields are not data fields, the other is what you want,

CodePudding user response:

In fact I think you rule out these null field needs not much meaning...

CodePudding user response:

Roughly understand, at the beginning of the database design, field according to demand design many, after after years of running the program, found that the company is not involved in a wide range of business, so in the database field is redundant, not form a complete set, keep the useless

CodePudding user response:

reference theliar reply: 3/f
roughly understand, at the beginning of the database design, field according to demand design many, after after years of running the program, found that the company is not involved in a wide range of business, so in the database field is redundant, not form a complete set with useless


Ha ha, it is really a disease, the beginning of all good big appetite

If it is in order to simplify table structure, is to do the meaningful things, although null will not occupy the physical space, but at least the table structure can relaxed a lot of ~
  • Related