Oracle 脚本(适应各种业务需要)
1. 取A表的数据,更新B表字段
update m_build b
set b.district_id=(
select d.district_id
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
where exists
(select 1
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
相关文档:
什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
select count(1) from dictionary;
select * from dba_data_files;
select count(1) from dba_objects t where t.owner='BESTTONE';
select * from dba_tablespaces t where t.tablespace_name='BESTTONE';
select count(1) from dba_tables t where t.owner='BESTTONE';
select t.table_name,t.comments from diction ......
一些基本的Oracle命令
基本命令
连接数据库
C:>SQLPLUS /NOLOG
SQL>CONN / AS SYSDBA
1.Oracle 关闭
SQL>SHUTDOWN (ABORT|IMMEDIATE|NORMAL)
2.Oracle 启动
SQL>STARTUP (REMOUNT|MOUNT|OPENT)
3.SQL> HELP SHOW
SHOW
----
Shows the value of a SQL*Plus system variable, or the
......
写存储过程时,用到拆分字符串,第一个传入参数为带分割符的字符串,第二个为分隔符的个数,下面是单提出来的分割字符串方法,
create or replace procedure split( ......