语法:LPAD(expr,n[,pad])

    RPAD(expr,n[,pad])

 

登录sqlplus测试

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 11月 16 16:26:42 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

请输入用户名:  /as sysdba

连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select lpad('test',20,'-') from dual;

LPAD('TEST',20,'-')

--------------------

----------------test

SQL> select lpad('test',3,'-') from dual;

LPA

---

tes

 

SQL> select rpad('test',3,'-') from dual;

RPA

---

tes

SQL> select rpad('test',20,'-') from dual;

RPAD('TEST',20,'-')

--------------------

test----------------

SQL>

 

posted on 2011-11-16 16:33  小波Ooo  阅读(2844)  评论(0编辑  收藏  举报