oracle循环的几种写法:declarex number :=5;begin--x:=0;loopx:=x+1;/*if (x=10) then exit; end if;*/exit when x=10;dbms_output.put_line('x='||x);end loop;dbms_output.put_line('outer');end;/------------------------------declarex number :=5;beginwhile x<10 loopx:=x+1;dbms_output.put_line(' Read More
posted @ 2011-07-10 22:46 庚武 Views(163) Comments(0) Diggs(0) Edit
DECODE语法:SELECT DECODE( <EXPR,SEARCH1,RESULT1,SEARCH2,RESULT2,...[,DEFAULT]>)FROM <TABLE_NAME>e.g.:select orderno,decode(ostatus,'p','准备处理','c','已完成')from order_master此函数可用于行转列:select * from scoreSELECT u_id, stu_name, SUM (DECODE (score_type, '语文' Read More
posted @ 2011-07-10 12:35 庚武 Views(222) Comments(0) Diggs(0) Edit