<small id='UZgtW'></small><noframes id='UZgtW'>

    1. <legend id='UZgtW'><style id='UZgtW'><dir id='UZgtW'><q id='UZgtW'></q></dir></style></legend>
    2. <i id='UZgtW'><tr id='UZgtW'><dt id='UZgtW'><q id='UZgtW'><span id='UZgtW'><b id='UZgtW'><form id='UZgtW'><ins id='UZgtW'></ins><ul id='UZgtW'></ul><sub id='UZgtW'></sub></form><legend id='UZgtW'></legend><bdo id='UZgtW'><pre id='UZgtW'><center id='UZgtW'></center></pre></bdo></b><th id='UZgtW'></th></span></q></dt></tr></i><div id='UZgtW'><tfoot id='UZgtW'></tfoot><dl id='UZgtW'><fieldset id='UZgtW'></fieldset></dl></div>
        <tfoot id='UZgtW'></tfoot>

        • <bdo id='UZgtW'></bdo><ul id='UZgtW'></ul>

        如何从具有非空值的表中选择列?

        How to select columns from a table which have non null values?(如何从具有非空值的表中选择列?)

            <small id='QiEgN'></small><noframes id='QiEgN'>

                <bdo id='QiEgN'></bdo><ul id='QiEgN'></ul>
              • <i id='QiEgN'><tr id='QiEgN'><dt id='QiEgN'><q id='QiEgN'><span id='QiEgN'><b id='QiEgN'><form id='QiEgN'><ins id='QiEgN'></ins><ul id='QiEgN'></ul><sub id='QiEgN'></sub></form><legend id='QiEgN'></legend><bdo id='QiEgN'><pre id='QiEgN'><center id='QiEgN'></center></pre></bdo></b><th id='QiEgN'></th></span></q></dt></tr></i><div id='QiEgN'><tfoot id='QiEgN'></tfoot><dl id='QiEgN'><fieldset id='QiEgN'></fieldset></dl></div>
                  <tbody id='QiEgN'></tbody>

                <tfoot id='QiEgN'></tfoot>
              • <legend id='QiEgN'><style id='QiEgN'><dir id='QiEgN'><q id='QiEgN'></q></dir></style></legend>
                1. 本文介绍了如何从具有非空值的表中选择列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个包含数百列的表,其中许多列为空,我想要我的 select 语句,以便只返回那些包含值的列.这将帮助我更好地分析数据.类似的东西:

                  I have a table containing hundreds of columns many of which are null, and I would like have my select statement so that only those columns containing a value are returned. It would help me analyze data better. Something like:

                  从表名中选择(非空列);

                  Select (non null columns) from tablename;

                  我想选择至少有一个非空值的所有列.

                  I want to select all columns which have at least one non-null value.

                  这能做到吗?

                  推荐答案

                  看看统计信息,可能对你有用:

                  Have a look as statistics information, it may be useful for you:

                  SQL> exec dbms_stats.gather_table_stats('SCOTT','EMP');
                  
                  PL/SQL procedure successfully completed.
                  
                  SQL> select num_rows from all_tables where owner='SCOTT' and table_name='EMP';
                  
                    NUM_ROWS
                  ----------
                          14
                  
                  SQL> select column_name,nullable,num_distinct,num_nulls from all_tab_columns
                    2  where owner='SCOTT' and table_name='EMP' order by column_id;
                  
                  COLUMN_NAME                    N NUM_DISTINCT  NUM_NULLS
                  ------------------------------ - ------------ ----------
                  EMPNO                          N           14          0
                  ENAME                          Y           14          0
                  JOB                            Y            5          0
                  MGR                            Y            6          1
                  HIREDATE                       Y           13          0
                  SAL                            Y           12          0
                  COMM                           Y            4         10
                  DEPTNO                         Y            3          0
                  
                  8 rows selected.
                  

                  例如,您可以检查 NUM_NULLS = NUM_ROWS 以识别空"列.
                  参考:ALL_TAB_COLUMNS、ALL_TABLES.

                  For example you can check if NUM_NULLS = NUM_ROWS to identify "empty" columns.
                  Reference: ALL_TAB_COLUMNS, ALL_TABLES.

                  这篇关于如何从具有非空值的表中选择列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                2. <tfoot id='zfF8b'></tfoot>

                  <small id='zfF8b'></small><noframes id='zfF8b'>

                          <tbody id='zfF8b'></tbody>
                      1. <i id='zfF8b'><tr id='zfF8b'><dt id='zfF8b'><q id='zfF8b'><span id='zfF8b'><b id='zfF8b'><form id='zfF8b'><ins id='zfF8b'></ins><ul id='zfF8b'></ul><sub id='zfF8b'></sub></form><legend id='zfF8b'></legend><bdo id='zfF8b'><pre id='zfF8b'><center id='zfF8b'></center></pre></bdo></b><th id='zfF8b'></th></span></q></dt></tr></i><div id='zfF8b'><tfoot id='zfF8b'></tfoot><dl id='zfF8b'><fieldset id='zfF8b'></fieldset></dl></div>
                        <legend id='zfF8b'><style id='zfF8b'><dir id='zfF8b'><q id='zfF8b'></q></dir></style></legend>
                          <bdo id='zfF8b'></bdo><ul id='zfF8b'></ul>