Oracle中的sql語句

來源:互聯網
上載者:User

要練好基本工,我不想工作的時候寫個簡單的查詢語句再翻課本喲.

create table test(Name varchar2(16),Age number(3),Birth date)
select * from test
select * from emp
select ename,sal,sal*12 + 100 from emp
select ename ||' work at ' || job from emp
select ename||null||job from emp
select comm*10 from emp
select ename,sal*12 "年薪" from emp
select ename,' Today is '||Sysdate "日期" from emp
select * from emp
select distinct sal from emp
select distinct deptno from emp
select ename,job,deptno from emp where ename='KING'
select ename,sal,comm from emp where sal<=1500
select empno,ename,sal,mgr from emp where mgr in(7902,7698,7566)
select ename from emp where ename like '%A%'
select lower(ename) from emp where lower(ename) like '%a%'
select lower(ename) from emp
select * from test
desc test

insert into test(name,age,birth) values('suncheng_hong',
25,sysdate)
select * from test
delete test
insert into test(name,age,birth) values('suncheng_HONG',
25,sysdate)
SELECT * FROM TEST
select name from test where lower(name)='suncheng_hong'
select * from test where lower(name)='suncheng_hong'
select ename,sal,comm from emp where sal between 1100 and 1500
select * from emp where ename like '_A%'
select * from emp
select * from emp where ename is null
select * from emp where comm is null
select * from emp where sal>1000 and job='CLERK'
select * from emp where job not in ('CLERK','ANALYST')
SELECT * FROM emp where (job ='SALESMAN' OR JOB = 'PRESIDENT') AND SAL>1500
SELECT * FROM emp where job ='SALESMAN' OR JOB = 'PRESIDENT' AND SAL>1500
select * from emp order by deptno desc,sal asc
select sal*12 annsal from emp order by annsal
select replace('oracle Sal','aaa') test from dual
select * from test

就到這裡吧,有點累了,沒有什麼技術成分,我還要是打一打,練熟一些,心裡踏實.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.