select sysdate from dual;
Select last_name, salary, trunc(salary * 1.155) "new salary"
from employees;
Select last_name, salary, trunc(salary * 0.155) "new salary"
from employees;
select last_name, LENGTH(last_name)
from employees
where substr(last_name, 0, 1) in ('J', 'A', 'M')
order by last_name asc;
Select last_name, trunc(months_between(sysdate, hire_date), 0)
from employees
order by trunc(months_between(sysdate, hire_date), 0) desc;
select last_name, lpad(salary, 15, '$') from employees;
select last_name, trunc((sysdate - hire_date) / 7, 2)
from employees
where department_id = 90;
select last_name, decode(commission_pct, '', '无奖金', commission_pct)
from employees;
Select job_id,
case job_id
when 'AD_PRES' then
'A'
when 'ST_MAN' then
'B'
when 'IT_PROG' then
'C'
when 'SA_REP' then
'D'
when 'ST_CLERK' then
'E'
else
'0'
end "Grage"
from employees;
select t.job_id,
decode(t.job_id,
'AD_PRES',
'A',
'ST_MAN',
'B',
'IT_PROG',
'C',
'SA_REP',
'D',
'ST_CLERK',
'E',
'0')
from employees t;
转载请注明原文地址:https://ipadbbs.8miu.com/read-8209.html