oracle分页语句&触发器

分页:

select * from (select a.*,rownum rn from (select a, b, c, d from haha where 1=1) group by (a, b, c, d)) aa where rownum<=20) where rn>10;

触发器:

create or replace trigger user1_chufa18 
after delete or insert or update on user1
for each row
begin
if deleting then
      delete from user1 where id =:old.id;
end if;
if inserting then
   insert into user1 (id,name)
      values  (:new.id,:new.name);
end if;
if updating then
    UPDATE user1
    SET name=:new.name
    where id =:old.id;
end if;
end user1_chufa18;



create or replace trigger user_chufa00
  before insert on tab_user  
  for each row
declare
  -- local variables here
begin
  if inserting then
   insert into user1 (id,username,password,realname,sex,cid,certtype,cert,birtyday,usertype,comments,rules,state,operator,operatordate)
      values  
(:new.id,:new.username,:new.password,,:new.realname,:new.sex,:new.cid,:new.certtype,:new.cert,:new.birthday,:new.usertype,:new.comments,:new.rules,:new.state,:new.operator,:new.operatordate
);end if;
end user_chufa00;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值