日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

Oracle数据库(三)

發(fā)布時間:2024/7/19 数据库 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Oracle数据库(三) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

專題一:oracle查詢

1.where查詢

  • 查詢部門編號是1的部門信息
select *from emp where deptno=1;
  • 查詢姓名是kw的員工,字符串使用‘’,內(nèi)容大小寫敏感
select *from emp where name='kw'
  • 查詢2018年1月4日入職的員工,注意oracle默認(rèn)日期格式(DD-MON-RR表示2位的年份)

select * from emp where hiredate = '4-1月-18';
  • 查詢age大于20的員工
select * from emp where age > 20;
  • 查詢age不等于20
select *from emp where age<>20;
  • 查詢年齡在20到25歲之間的員工信息
select *from emp where (age>20) and (age <25);
或者
select *from emp where age between 20 and 25;
  • 查詢age不在20到25之間的員工信息
select *from emp where age NOT between 20 and 25;

總結(jié):between……and……,小數(shù)據(jù)必須在前,大數(shù)據(jù)在后。

不等于符號<>或者!=

  • or的使用,in的使用
  • 查詢名字為kw或者為wq的信息
select *from emp where name='kw' or name='wq';
或者
select *from emp where name in ('kw','wq');
  • 模糊查詢
select *from emp where name like 'k%' --匹配0個,1個或者多個
  • 查詢以w結(jié)尾的員工信息
select *from emp name like '%w''
  • 查詢第一個為k,最后一個是q的員工信息
select *from emp where name like 'k%q'
  • 查詢第一個為k,第三個是q的員工信息
select *from emp where name like ‘k_q’;
  • 查詢叫k_的員工
select *from emp where name like 'k_' escape '\';
  • 對于數(shù)據(jù)的查詢?nèi)绻瘮?shù)‘’‘的是數(shù)據(jù),需要使用‘進(jìn)行轉(zhuǎn)義
  • 查詢null的數(shù)據(jù),使用is null;
select *from emp where comm is null;
  • 查詢數(shù)據(jù)的獎金為null,傭金大于1000的
select *from emp where (comm is null) and (sal>1000);
  • 查詢薪水是100,200,300.400的元工信息
select *from emp where sal in(100,200,300,400);

轉(zhuǎn)載于:https://www.cnblogs.com/kw28188151/p/8192521.html

總結(jié)

以上是生活随笔為你收集整理的Oracle数据库(三)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。