OCP

desc dba_objects;

select * from dba_objects where rownum = 6;

select owner, object_id from dba_objects;

select * from dba_objects where object_name = ‘CON$’;

select  count(*)  from  hr.employees;

select  count(1)  from  hr.employees;/rowid进行运算

select distinct(job_id) from hr.employees;

select  *  from  hr.job_history;

select * from departments;

select * from 

declare

begin

exception

end;

create or replace 

-------------------------------------

null

Null

NULL

''

-------------------------------------

create  table  nt (id char(10));

alter table nt add columns (sq number);

drop table nt;

insert into nt values (1, 'null');

insert into nt values(2, 'Null')

insert into nt values(3, 'NULL')

insert into nt values(4, ' ')

insert into nt values(5, null)

insert into nt values(6, Null)

insert into nt values(7, NULL)

select count(1)  from nt;

create table nt(sq number, cont varchar(10));

select distinct(cont) from nt;

select last_name, job_id, salary, commission_pct, 'AAAA', 'BBBB' FROM hr.employees;

---------------------------------------------------------------

select table_name from dba_indexes where ;

---------------------------------------------------------------

select ''||index_name||'' from where ;

---------------------------------------------------------------

select  department_name  ||  q'#  Manager's :  #'  ||  manager_id from hr.departments;

--------------------------------------------------------------

select distinct department_id from employees;

--------------------------------------------------------------

1、oracle表名都是大写的

2、

------------------------------------------------------------

with tmp as (

select upper(last_name) a, job_id b from employees),;

select a, b from tmp where last_name = 'Whale';

------------------------------------------------------------

show parameter date;

select sysdate from dual;

alter session set nls_data_format = 'yyyy-mm-dd hh24:mi:ss';

------------------------------------------------------------

select sysdate from dual;

select to_char(sysdate, yy-DD-mm);

select to_char(sysdate, 'yy-dd-mm') from dual;

-----------------------------------------------------------

DECLARE

id number;

id:=10;

begin

EXECUTE immediate select * from hr.employees where employee_id = $id;

end;

/

-----------------------------------

猜你喜欢

转载自www.cnblogs.com/niaocaizhou/p/10848237.html
OCP