SQL&PLSQL
tech2011
这个作者很懒,什么都没留下…
展开
-
exception
<br />exception<br /> when no_data_found then原创 2010-12-16 10:30:00 · 445 阅读 · 0 评论 -
sql调整一
<br />一个查询:<br />open outcurlist for<br /> select t.*<br /> from tbcharge t<br /> where t.state=-1<br /> and not exists<br /> (<br /> select 1 from<br /> (<br /> select t13.ptid from tbcharge t13<br原创 2010-11-08 14:13:00 · 236 阅读 · 0 评论 -
分页
<br /> select /*+first_rows*/<br /> cid,pid,cname,cnt,rn<br /> from <br /> (select t.* ,row_number() over(order by t.cid desc) rn<br /> from tb_jff t<br /> )<br /> where rn <=3* 2<br /> and rn >(2-1)*3;<br />原创 2010-11-08 14:48:00 · 197 阅读 · 0 评论 -
job运行时间日志保留
<br />CREATE OR REPLACE PACKAGE BODY is<br /> <br /> procedure joblog(v_job varchar2,<br /> v_starttime timestamp,<br /> v_endtime timestamp,<br /> v_comments varchar2) is<br /> <br /> p原创 2010-11-09 17:27:00 · 680 阅读 · 0 评论 -
外部表
Drop Table tb_sql_ldr_fei;CREATE TABLE tb_sql_ldr_fei(SERVICEIDITEM number(12),AREAIDITEM Number(12),GROUPIDITEM Number(12), CONTEXTID varchar2(50), ORDERID varchar2(50),ITEMID Number(12),ITEMNUM Number(12),ITEMAMOUNT Nu原创 2011-01-19 16:59:00 · 357 阅读 · 0 评论 -
for
<br />Declare <br /> V_1 Varchar2(100);<br /> i Integer:=0;<br />Begin<br /> For c1 In(Select * From tb_tmp) Loop<br /> <br /> i:=I+1;<br /> If Mod(i,100)=0 Then<br /> Commit;<br /> End If;<br /> End Loop;<br />Commit;<br />End;原创 2011-02-18 15:00:00 · 259 阅读 · 0 评论 -
top n
<br />On Top-n and Pagination Queries<br />By Tom Kyte<br /> <br />Our technologist gets more results using ROW_NUMBER, RANK, and DENSE_RANK.<br />In a recent Ask Tom column (September/October 2006), I wrote about using ROWNUM to perform top-n queries, get原创 2011-02-18 19:12:00 · 596 阅读 · 0 评论 -
正则表达式
<br />4 new functions has been introduced:-<br />REGEXP_LIKE<br />REGEXP_REPLACE<br />REGEXP_INSTR<br />REGEXP_SUBSTR<br /><br />The following data types are supported with REGEXP functions:<br />- CHAR<br />- VARCHAR2<br />- NCHAR<br />- NVARCHAR2 <br />-原创 2011-02-18 19:06:00 · 608 阅读 · 0 评论