資料庫開發基礎---常見面試題

lff1530983327發表於2015-03-04

create table a (t varchar2(20))

alter table a add  s varchar2(20);

alter table a drop column  s;

---刪除子分割槽   

 alter table 分割槽表名

drop partition  子分割槽名;

delete  from t a1 where  a1.rowid not in (select max(a2.rowid) from t a2 group  by a2.xx);commit;

Select Count(Decode(deptno, 20'1'Null)) cnt_20,

       Sum(Decode(deptno, 20, sal, 0)) sum_sal_20,

       Count(Decode(deptno, 30'1'Null)) cnt_30,

       Sum(Decode(deptno, 30, sal, 0)) sum_sal_30

  From emp

 Where ename Like 'SMITH%'

   and deptno in (2030);

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30018455/viewspace-1447969/,如需轉載,請註明出處,否則將追究法律責任。

相關文章