insert into t1 values(default,null,'abc');
create view v1 as select a,b,c from t1;--建一个不包含有默认值的那一列的view
insert into v1 values();
alter table emp add constraints constr1 check(sal>0);
insert into(select a,b,c from emp where hiredate<sysdate with check option) values();
insert first when job in('a','b') then
into emp1(a,b,c) values()
when deptno in () then
into emp2(a,b,d) values()
select a,b,c,d from emp;
merge into t1 using(select...) sss on(t1.id=sss.id)
when matched then update set t1.b=..
when not matched then insert(t1.a,t1.b) values(sss.);
select t.*,row_number() over(partition by accno order by createDate) row_number from Test t;
select t.*,rank() over(partition by accno order by createDate) row_number from Test t;
select t.*,dense_rank() over(partition by accno order by createDate) row_number from Test t;
select createDate,accno,money,row_number from (select t.*,row_number() over(partition by accno order by createDate) row_number from Test t) t1 where row_number<4
delete from tt t1 where exists(select null from tt t2 where t1.name=t2.name and t2.id>t1.id);
更新插入
最新推荐文章于 2023-06-08 22:34:45 发布