select * from EMp--all data in EMP table
select * from EMP where ename in('SMITH')--the data where ename is SNITH in the EMP table
select ename||'is a' as INAME from EMP where eNAME = 'SMITH'--rename ENAME pius 'is a' to INAME
select sal || '_'||ename as employees from emp --sal plus ename to employees
select distinct sal from emp--delete the same rows
select * from emp order by sal desc--show the all data in the sal's data to up order
select * from emp where hiredate = '03-12月-81'--show the data when the hiredate is '1981-12-03'
select *from emp
where sal between 1100 and 3000 --select the data of sal 1100 to 3000
select * from emp
where deptno in (10,20)--where the deptno is 10 or 20
select * from emp where ename like '%_'--maybe
select * from emp where comm is null--nothing
select * from emp where lower (ename) = 'smith' -- change the word to lowercase
select initcap(ename) from (select lower(ename) as ename from emp)--change the first letter to capital
select concat('hello ','world')from dual--attach the two word
select substr('goodgoodstudydaydayup',5,9)from dual--cut nine letter start for five from the words
select length('goodgoodstudydaydayup')from dual--how many letter in the words
select instr('goodgoodstudydaydayup','s')from dual--the index of the letter 's' in the words
select lpad('goodgoodstudydaydayup',30,'-')from dual--make the words has 30 letters with the assignation words in the end,others fill in '-'
select rpad('goodgoodstudydaydayup',30,'-')from dual--make the words has 30 letters with the assignation words in the beginning,others fill in '-'
select trim('p' from 'goodgoodstudydaydayup')from dual--delete the letter 'p' from the starting or the end of the words
select round(3.1415926535,4)from dual--retention 4 decimal point with rounding of the number
select trunc(3.1415926535,4)from dual--cut 4 decimal point from the number
select mod(10,3)from dual --get the remainder
select sysdate from dual--get the currentdate of the system
select hiredate+5 from emp--the date plus 5,result is new date
select months_between('01-8月-95','11-7月-94')from dual--the defference of the two date
select add_months('01-7月-90',7)from dual--the date add to 7 months
select * from emp order by sal desc--descending order
select next_day(sysdate,'星期一')from dual--the date of the next monday
select last_day(sysdate)from dual--the last day of the month of the assignation date
select replace('goodgoodstudydaydayup','d','y')from dual--replace 'd' to 'y'
select to_char(sysdate,'yyyy')from dual--the year of currentdate
select to_char(sysdate,'fmyyy-mm-dd')from dual--format the system date to year-month-day
select to_char(sal,'$999,999,999')from emp--format the currency
select to_number('')+to_number('')from dual--transform varchar to number
select to_date('','yyyymmdd')from dual--transform from varchar to date
select *from emp where hiredate = last_day(hiredate)-2--reciprocal 3 days
select *from emp where hiredate <= add_months(sysdate,-25*12)--25years ago
select initcap(concat('dear',ename)) from emp--the front of all ename add to 'dear',the change the first letter to capital
select * from emp where length(ename) = 5--whose the length of name is 5
select *from emp where ename not like ('%R%')--whose name without the letter 'R'
select substr(ename,0,1) from emp --select the first letter of name

注:每个Select后为一个单独语句,需在结束后加分号“ ; ”,否则无法一起运行

Oracle数据库select语句的更多相关文章

  1. ORACLE数据库SQL语句的执行过程

    SQL语句在数据库中处理过程是怎样的呢?执行顺序呢?在回答这个问题前,我们先来回顾一下:在ORACLE数据库系统架构下,SQL语句由用户进程产生,然后传到相对应的服务端进程,之后由服务器进程执行该SQ ...

  2. Oracle数据库基本语句练习

    以ORACLE数据库为主提纲:第一部分.SQL语言基础 第一章:Oracle命令类别及sql简单语法介绍第二章:oracle的基本函数第三章:oracle的数据类型第四章:多表连接技术 第二部分.or ...

  3. Oracle中Select语句完整的执行顺序

    oracle Select语句完整的执行顺序: .from 子句组装来自不同数据源的数据: .where 子句基于指定的条件对记录行进行筛选: .group by子句将数据划分为多个分组: .使用聚集 ...

  4. Oracle 查询(SELECT)语句(一)

    Ø  简介 本文介绍 Oracle 中查询(SELECT)语句的使用,在 SQL 中 SELECT 语句是相对内容较多的,也是相对比较复杂一点的,所以这里拿出来单独学习. 首先,我们先来理一下思路,我 ...

  5. MySQL数据库select语句的使用方法

    select语句可 以用回车分隔 $sql="select * from article where id=1"和 $sql="select * from article ...

  6. Oracle数据库的语句级读一致性

    数据库:Oracle 前提:假定100万行的记录,在最后一行有一个数据a=1. 实验:你在9:00的时候查找数据,9:05的时候查到最后一行:但是,在9:01的时候有人修改了最后一行数据并提交(com ...

  7. oracle数据库常用语句

    --查看数据库版本-- select * from product_component_version; -- 查看dbf存放位置 select * from dba_data_files; -- 查 ...

  8. Oracle数据库SQL语句操作大全汇总

    数据库各个表空间增长情况的检查: SQL >SELECT A.TABLESPACE_NAME,( 1-(A.TOTAL)/B.TOTAL)* 100 USED_PERCENT FROM (SEL ...

  9. Oracle数据库SQL语句的分类

    1986年10月,美国国家标准协会对SQL进行规范后,以此作为关系式数据库管理系统的标准语言,1987年在国际标准组织的支持下成为国际标准.不过各种通行的数据库系统其实在实践过程中都对SQL规范的作了 ...

随机推荐

  1. SpringBoot 使用Thymeleaf解决静态页面跳转问题

    参考:springboot配置跳转html页面 1,首先在pom文件中引入模板引擎jar包 <dependency> <groupId>org.springframework. ...

  2. oracle 11g创建数据库教程

    cd /oracle/app/oracle/product//dbhome_1/bin ./dbca 自定义用户表空间大小. 安装过程半个小时是需要的. 2.配置oracle系统用户环境变量 使用vi ...

  3. mysql sql_mode=only_full_group_by问题?

    视图查询的时候本地数据库报错: 解决办法: 1.查看sql_mode select @@global.sql_mode STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_Z ...

  4. CAD(布置厨洁具)(尺寸标注)5.12

    "TYTK"打开图库,找到平面厨具和洁具.双击选中的厨具,A可以不停旋转90度.给厨具选取正确的位置.画出灶台线,同理画出卫生间的家具.绘制出洗脸台的平台.浴缸的平台. 尺寸标注: ...

  5. PHP开发者的Linux学习之路

    谈起一个高效动态网站的构建,那就不得不提到LAMP,即Linux操作系统.Apache网络服务器.Mysql数据库.Perl.PHP或Python编程语言等开源产品所组成的网站架构框架,其最大的优势是 ...

  6. 图片加载------reactVirtualized

    作用: 让HTML文档始终保持固定数量的图片数量,可以节省带宽

  7. C++ Templates 关于程序库的概念和通用工具

    using namespace std所谓的命名空间,就是一种将程序库名称封装起来的方法,它就像在程序库中竖立了一道围墙 标准程序库中有一部分,比如string classes,支持具体的错误处理,它 ...

  8. 关于js的对象原型继承(二)

    本章讨论使用new一个构造函数来创建一个对象. 前期知识点说明: 1.prototype是函数的一个属性,每个函数都有一个prototype属性.这个属性是一个指针,指向一个对象.它是显示修改对象的原 ...

  9. C++输出数组名

    1.如果C++输出的数组是char类型的,那么输出的就是数组中的元素. 2.如果使用的是其他类型的数组作为输出的话,那么就是一个16进制的地址. 3.还是那句话,对数组的操作,很多时候都是指针的操作, ...

  10. Python select 详解(转)

    I/O多路复用是在单线程模式下实现多线程的效果,实现一个多I/O并发的效果.看一个简单socket例子: import socket SOCKET_FAMILY = socket.AF_INET SO ...