Oracle数据库根据不同条件给同一字段修改相应的值
Jun 07, 2016 pm 05:34 PMOracle数据库根据不同条件给同一字段修改相应的值: 例如:根据职务调整雇员的工资,如果职务为ldquo;SALESMANrdquo;或者ldquo
Oracle数据库根据不同条件给同一字段修改相应的值:
例如:根据职务调整雇员的工资,如果职务为“SALESMAN”或者“ANALYST”工资上调100元,如果职务为“MANAGER”工资上调200元,其它职务工资上调50元。
update emp
set sal=(
case
when job in('SALESMAN','ANALYST') then sal+100
when job = 'MANAGER' then sal+200
else sal+50
end
);
查询出当前的oracle数据库系统时间
日期:select sysdate from dual;
或 select current_date from dual;
日期+时间:select systimestamp from dual;
本月最后一天:last_day(sysdate)
格式化日期:
select tochar(sysdate,'YYYY/YY-MM-DD HH24:MI:SS') from dual;
星期几:
select tochar(sysdate,'day') from dual;
day/dy 表示星期几
d表示一周中的第几天,从1(周日为第一天)开始算

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to check which table space a table belongs to in Oracle

How to connect to Oracle database using PDO

How to retrieve only one piece of duplicate data in oracle

Implement data import into PHP and Oracle databases

How oracle determines whether a table exists in a stored procedure

How to use PHP and Oracle database connection pools efficiently

How to use php to extend PDO to connect to Oracle database
