Oracle中的REPEAT函数等效 [英] REPEAT function equivalent in Oracle
问题描述
我想知道如何实现与SQL * Plus中的REPEAT()相同的功能.例如,考虑以下问题:将字符"*"显示为给定表中每个条目指定的整数属性指定的值.
I would like to know how to achieve the same functionality as REPEAT() in SQL*Plus. For example consider this problem: display the character '*' as many times as the value specified by an integer attribute specified for each entry in a given table.
推荐答案
挑剔:SQL * Plus没有任何功能. 数据库服务器(Oracle)提供了执行SQL的功能,并具有以下功能:
Nitpicking: SQL*Plus doesn't have any feature for that. The database server (Oracle) provides the ability to execute SQL and has such a function:
您正在寻找rpad()
select rpad('*', 10, '*')
from dual;
将输出
**********
更多详细信息,请参见手册: https ://docs.oracle.com/cd/E11882_01/server.112/e41084/functions159.htm#SQLRF06103
More details can be found in the manual: https://docs.oracle.com/cd/E11882_01/server.112/e41084/functions159.htm#SQLRF06103
这篇关于Oracle中的REPEAT函数等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!