oracle_百分比计算
select round(sum(case when o.close_date is null then 1 else 0 end)/count(*),3)*100||'%' SCALE from order o
说明:使用sum对一定条件的数据求和后,与总数进行比较。
||'%' 为以的百分号形式输出结果(例:2%)
相关文档:
什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
1.创建表:
a. 创建xs表中计算机专业学生的备份
Create table xs_jsj as select * from xs where zym=’计算机’;
b.完整的例子:
Create table test ......
1.创建表:
a. 创建xs表中计算机专业学生的备份
Create table xs_jsj as select * from xs where zym=’计算机’;
b.完整的例子:
Create table test ......
首先写好建库脚本c.sql
create database mydb
controlfile reuse
maxinstances 1
maxloghistory 1
maxlogfiles 5
maxlogmembers 5
maxdatafiles 100
datafile '$ORACLE_HOME/oradata/system01.dbf'size 325M reuse
autoextend on next 10240K maxsize unlimited
u ......
‘开始’-->‘运行’--> 输入‘cmd’ 打开cmd.exe -->输入‘cd c:\’ 切换到 c:\>
启动Oracle
c:\> svrmgrl
svrmgrl> connect internal/oracle
svrmgrl> startup
svrmgrl> exit
启动监听器
c:\> lsnrctl start ......