您的位置:首页 > 数据库 > Oracle

oracle中rpad函数和lpad函数

2011-11-16 16:33 295 查看
语法: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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: