Home Database Mysql Tutorial Oracle数据库根据不同条件给同一字段修改相应的值

Oracle数据库根据不同条件给同一字段修改相应的值

Jun 07, 2016 pm 05:34 PM
oracle database

Oracle数据库根据不同条件给同一字段修改相应的值: 例如:根据职务调整雇员的工资,如果职务为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(周日为第一天)开始算

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to check which table space a table belongs to in Oracle How to check which table space a table belongs to in Oracle Jul 06, 2023 pm 01:31 PM

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

How to connect to Oracle database using PDO How to connect to Oracle database using PDO Jul 28, 2023 pm 12:48 PM

How to connect to Oracle database using PDO

How to retrieve only one piece of duplicate data in oracle How to retrieve only one piece of duplicate data in oracle Jul 06, 2023 am 11:45 AM

How to retrieve only one piece of duplicate data in oracle

Implement data import into PHP and Oracle databases Implement data import into PHP and Oracle databases Jul 12, 2023 pm 06:46 PM

Implement data import into PHP and Oracle databases

How oracle determines whether a table exists in a stored procedure How oracle determines whether a table exists in a stored procedure Jul 06, 2023 pm 01:20 PM

How oracle determines whether a table exists in a stored procedure

Does oracle database require jdk? Does oracle database require jdk? Jun 05, 2023 pm 05:06 PM

Does oracle database require jdk?

How to use PHP and Oracle database connection pools efficiently How to use PHP and Oracle database connection pools efficiently Jul 12, 2023 am 10:07 AM

How to use PHP and Oracle database connection pools efficiently

How to use php to extend PDO to connect to Oracle database How to use php to extend PDO to connect to Oracle database Jul 29, 2023 pm 07:21 PM

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

See all articles