SQL笔记

//创建表
CREATE TABLE myemp (mid NUMBER(4),mname VARCHAR2(20),birthday DATE);

//创建表及导入数据
CREATE TABLE myemp AS SELECT empno,ename,hiredate FROM emp;

//删除表
DROP TABLE myemp;

//insert语句
INSERT INTO myemp (empno,ename,hiredate) VALUES (7788,'FSL',SYSDATE);
//快速复制
INSERT INTO myemp (empno,ename,hiredate) SELECT empno,ename,hiredate FROM emp;

//Update语句
UPDATE myemp set hiredate=to_date('2013-1-1','YYYY-MM-DD') WHERE ename='FSL';

//DELETE语句
DELETE FROM myemp WHERE ename='FSL';

//SELECT 语句
select * from emp;
分页查询
select * from (select t1.*,rownum rn from (select * from emp where 1=1) t1 where rownum<=10) where rn>=6;




你可能感兴趣的:(delete,select,create,insert into)