简体   繁体   English

在 oracle 11g 中的单个列中对齐值

[英]Alliging values within a single column in oracle 11g

My select statement looks like this:我的选择语句如下所示:

select RPAD(label,40) || count (*) from table

My result looks like this:我的结果是这样的:

label             1
otherlabel       3
anotherlabel    0

How can I get my count() number to line up?我怎样才能让我的count()号码排队? I have tried using various combination of LPAD and RPAD but because the text characters are not of set width , the numbers are allways slightly off.我曾尝试使用LPADRPAD 的各种组合,但由于文本字符没有设置宽度,因此数字总是略微偏离。 anyone have a trick for this?有人对此有窍门吗?

So I want :所以我想要:

label           1
otherlabel      3
anotherlabel    0

Can anyone help me with this?谁能帮我这个?

This is a font problem.这是字体问题。 Use a monospaced font (where all letters have the same width) in your app and you are done.在您的应用程序中使用等宽字体(其中所有字母的宽度相同),您就完成了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM