开发者

Oracle SQLPlus: Underline format when computing sum on multiple columns

I am computing the sum of multiple columns on the same break, but the output only displays a dash (-) underline between the last record and the column totals for a single column only...and it appears to always be the second column upon which the sums are being computed. Is there a reason for this and a way to apply the underline format开发者_开发百科 to all columns?

Any assistance would be greatly appreciated. Thanks.


This is what I get in SQL*Plus 11.2 instant client against a 10g database (I've trimmed out some detail lines, so the sums won't actually match).

If your results don't match, I suggest you post more details (client version, table and query versions, sample output...)

break on owner
compute SUM OF leaf_blocks on owner
compute SUM OF num_rows on owner

select owner, index_name, leaf_blocks, num_rows
from all_indexes
where owner in ('MDSYS','CTXSYS')
and num_rows > 0
order by owner, index_name;

OWNER       INDEX_NAME                     LEAF_BLOCKS  NUM_ROWS
----------- ------------------------------ ----------- ---------
CTXSYS      DRC$IDX_COLUMN                        1.00      1.00
            DRX$IXV_KEY                           1.00    118.00
            DRX$OAL_ID                            1.00    120.00
            SYS_IOT_TOP_9752                      1.00    114.00
            SYS_IOT_TOP_9778                      2.00    333.00
***********                                ----------- ---------
sum                                              23.00  1,275.00
MDSYS       SDO_COORD_OPS_COORD_OP_TYPE          12.00  2,244.00
            SDO_COORD_REF_SYS_KIND               21.00  4,384.00
            SDO_COORD_SYS_COORD_SYS_TYPE          1.00     65.00
            SDO_DATUMS_DATUM_TYPE                 2.00    530.00
            SYS_C003008                          15.00  4,384.00
            UNIQUE_STYLES                         1.00     78.00
            UNIT_OF_MEASURE_PRIM                  1.00    128.00
***********                                ----------- ---------
sum                                             137.00 32,202.00
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜