select * from jcls_lawfirms where length(lf_2)=2 for update
select * from jcls_lawfirms where length(lf_2)>4
select * from jcls_lawfirms where lf_1 like '%凉山%'for update
select * from jcls_lawfirms where lf_2 like '%江油%'
update jcls_lawfirms set lf_2 = '都江堰市'where lf_2 like '%都江堰%'
update jcls_lawfirms set lf_2 ='金堂县'where l_firmname = '金堂县广兴法律服务所'
select * from jcls_lawfirms where l_firmname = '金堂县广兴法律服务所'
delete from jcls_lawfirms where l_id ='2553'
select * from jcls_lawfirms where l_id ='2553'
update jcls_lawfirms set l_firmname ='峨眉山市符溪法律服务所'where l_id ='2553'
select * from jcls_lawfirms for update
select * from jcls_lawfirms where length(l_firmname)<10

名称:l_firmname 组织形式:l_firmproperty 负责人:l_director 地址:l_address 联系电话:l_phone 所属地市:lf_1

---------------------------------------------------------------------------------------
select y.l_id,y.l_lawfirmsid,y.l_name,y.l_la1,f.lf_1,f.lf_2 from jcls_lawfirms f,jcls_lawyer y where y.l_lawfirmsid=f.l_id

select y.l_id,y.l_lawfirmsid,y.l_name,y.l_la1,f.lf_1,f.lf_2
0:id 1:机构id 2:姓名 3:机构名 4:市 5:县

alter table Tablename add(column1 varchar2(255))
update gzc_notary_office set jgbm='5101'where n_areacounty like '成都%'
update gzc_notary_office set jgbm='5107'where n_areacounty like '绵阳%'
update gzc_notary_office set jgbm='5103'where n_areacounty like '自贡%'
update gzc_notary_office set jgbm='5104'where n_areacounty like '攀枝花%'
update gzc_notary_office set jgbm='5105'where n_areacounty like '泸州%'
update gzc_notary_office set jgbm='5106'where n_areacounty like '德阳%'
update gzc_notary_office set jgbm='5108'where n_areacounty like '广元%'
update gzc_notary_office set jgbm='5109'where n_areacounty like '遂宁%'
update gzc_notary_office set jgbm='5110'where n_areacounty like '内江%'
update gzc_notary_office set jgbm='5111'where n_areacounty like '乐山%'
update gzc_notary_office set jgbm='5113'where n_areacounty like '南充%'
update gzc_notary_office set jgbm='5115'where n_areacounty like '宜宾%'

update gzc_notary_office set jgbm='5116'where n_areacounty like '广安%'
update gzc_notary_office set jgbm='5117'where n_areacounty like '达州%'
update gzc_notary_office set jgbm='5119'where n_areacounty like '巴中%'
update gzc_notary_office set jgbm='5118'where n_areacounty like '雅安%'
update gzc_notary_office set jgbm='5114'where n_areacounty like '眉山%'
update gzc_notary_office set jgbm='5120'where n_areacounty like '资阳%'
update gzc_notary_office set jgbm='5132'where n_areacounty like '阿坝%'
update gzc_notary_office set jgbm='5133'where n_areacounty like '甘孜%'
update gzc_notary_office set jgbm='5134'where n_areacounty like '凉山%'

delete from jcls_lawyer

DROP TRIGGER jcls_lawyer_trigger

create sequence position_seq
start with 1
increment by 1
minvalue 1
maxvalue 9999999
nocycle
nocache
noorder;

create or replace trigger jcls_lawyer_trigger
before insert on jcls_lawyer
for each row
begin
select position_seq.nextval into :new.l_id from dual;
end ;

insert into jcls_lawyer(l_lawfirmsid,l_la1,l_name)
with temp as
(
select l_id as id,l_firmname as firmname,lf_3 as text from jcls_lawfirms
)
select id,firmname,substr(text,instr(text,'、',1,rn)+1,instr(text,'、',1,rn+1)-instr(text,'、',1,rn)-1) text from
(
select id,firmname,'、'||t1.text||'、' text,t2.rn from
(select id,firmname,text,length(text)-length(replace(text,'、',''))+1 rn from temp) t1,
(select rownum rn from all_objects where rownum <= (select max(length(text)-length(replace(text,'、',''))+1) rn from temp)) t2
where t1.rn >= t2.rn order by text,rn
)

select * from jcls_lawyer
———————————————————————————————————————————
select * from rmtj_twh t where xian is null

update rmtj_twh set xian =(select dq from xzqh where xzqh.bm = '510105') where rmtj_twh.bm like'510105%'
update rmtj_twh set xian =(select dq from xzqh where xzqh.bm = '510106') where substr(rmtj_twh.bm,1,6)='510106'

select dq from xzqh where bm like '5101%'

begin
for i in reverse 513221..513437 loop
update rmtj_twh set xian =(select dq from xzqh where xzqh.bm = i) where substr(rmtj_twh.bm,1,6)=i;
end loop;
end;

select id,zztype,zzname,createdate,phone,address,city from rmtj_twh

select id,zztype,zzname,createdate,phone,address,city from rmtj_twh where 1=1 and city = '省直属' order by id
select r.id,r.zztype,r.zzname,r.createdate,r.phone,r.address,r.city from rmtj_twh r where 1=1
---------------------------------------------------------------------------------------
根据另一张表修改表字段
update lss_lawyer t set sortnum ='9' where exists(select 1 from ac07 a where t.idcard=a.aac002 and a.aac009 is not null)
---------------------------------------------------------------------------------------

联表查询
DetachedCriteria cre = DetachedCriteria.forClass(NataryPersonnal.class);

if (group != null) {
String groupcode = group.getGroupCode();
if (groupcode.substring(4, 6).equals("00")) {
groupcode = groupcode.substring(0,4);
}
DetachedCriteria unitinfo = DetachedCriteria.forClass(NotaryOffice.class);
unitinfo.add(Restrictions.like("jgbm", (groupcode+"%")));
unitinfo.setProjection(Property.forName("nid"));
cre.add(Property.forName("notaryId").in(unitinfo));
}

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

如何在Oracle中复制表结构和表数据 【转载】

1. 复制表结构及其数据:

create table table_name_new as select * from table_name_old

2. 只复制表结构:

create table table_name_new as select * from table_name_old where 1=2;

或者:

create table table_name_new like table_name_old

3. 只复制表数据:

如果两个表结构一样:

insert into table_name_new select * from table_name_old

如果两个表结构不一样:

insert into table_name_new(column1,column2...) select column1,column2... from table_name_old

pasting

-----------------------------------------------------------------------------
不等于(可查看为空的) and nvl(l.islvsuo,'xx')<>'0'

最新文章

  1. C# .Net :Excel NPOI导入导出操作教程之将Excel文件读取并写到数据库表,示例分享
  2. 用Burpsuite破解网站密码
  3. 1Z0-053 争议题目解析692
  4. Neutron 理解(5):Neutron 是如何向 Nova 虚机分配固定IP地址的 (How Neutron Allocates Fixed IPs to Nova Instance)
  5. OC基础(25)
  6. github 中redisPhpAdmin redis 可视化界面
  7. jQuery模拟原生态App上拉刷新下拉加载
  8. uIP中国的协议文件:Ch01
  9. Spring应用上下文中Bean的生命周期
  10. nginx地址代理(2)
  11. caffe常用
  12. 理解bootstrap的列偏移offset 和 推拉push/pull的区别?
  13. skynet的火焰图
  14. Servlet 线程安全
  15. php date_default_timezone_set()设置时区
  16. Kubernetes集群部署之一系统环境初始化
  17. jsp中的include静态包含与动态包含,
  18. Postgresql 正则表达式
  19. python -- 解决UnicodeEncodeError问题
  20. Spring的IOC理解(转载)

热门文章

  1. hdu 1540 Tunnel Warfare (区间线段树(模板))
  2. WebService积累
  3. 四大主流云平台对比--CloudStack, Eucalyptus, vCloud Director和OpenStack。
  4. 九度 链表中倒数第k个结点
  5. Visual Studio 那些隐藏的调试功能(转)
  6. Oracle Form 特殊的默认值 $$variables$$
  7. Android开发之ListView-BaseAdapter的使用
  8. BZOJ_1617_[Usaco2008_Mar]_River_Crossing_渡河问题_(动态规划)
  9. ☀【Zepto】
  10. NSArray和NSMutableArray的copy和MutableCopy