oracle lpad函数

1在oracle的数据库里有个函数 LPAD(String a,int length,String addString).

              2作用:把addString添加到a的左边,length 是返回值的长度。

               3例子

                  A : SQL> select lpad('test',8,0) from dual;

                LPAD('TEST',8,0)
                    ----------------
                 0000test

               B: select lpad('test',8) from dual;

              LPAD('TEST',8)
                         --------------
               test 注:不写最后一个参数,函数会默认在返回值左边加一个空格。

               C: SQL> select lpad('test',2,0) from dual;

                LPAD('TEST',2,0)
                ----------------
              te

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

                   LPAD('TEST',3)
                  --------------
                    tes

你可能感兴趣的:(oracle,sql,C++,c,C#)