博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SQL:exist使用
阅读量:5947 次
发布时间:2019-06-19

本文共 5721 字,大约阅读时间需要 19 分钟。

hot3.png

select * from tanjo_data WHERE P_NO IS NOT NULL --AND IKEYUSE IS NULLselect * from pfs_userm where user_id = 1721select * from pfs_userm where ikeyvalue is not null--UPDATE TANJO_DATA SET IKEYUSE='1' WHERE P_NO IS NOT NULL AND IKEYUSE IS NULL--backupcreate table pfs_userm_0625 as select * from pfs_usermselect count(*) from pfs_userm_0625create table pfs_usergrouprel_0625 as select * from pfs_usergrouprelselect count(*) from pfs_usergrouprel_0625select * from pfs_userm where ikeypath is not nullselect * from pfs_usergroup where ap_id = 18261select * from am.userm@am where ikey is not null and YN_SYSUSER=0--update ikey/*update pfs_userm a set (useikey,ikeypath,ikeyfile1,ikeyfile2,ikeyvalue)=(select b.ikeyuse, b.dir,b.file1id,b.file2id,b.p_no from tanjo_data b where b.pwf_user_id=a.user_id) where exists (select 1 from tanjo_data b where b.pwf_user_id=a.user_id and b.P_NO IS NOT NULL);commit;*/--update pfs_usergrouprelselect * from select * from pfs_usergrouprel where usergroup_id in(1800044,1800045,1800046,1800047,1800048,1800155,1800157);--delete pfs_usergrouprel  where usergroup_id in(1800044,1800045,1800046,1800047,1800048,1800155,1800157);insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(1,1000)),1800044,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and rtrim(a.user_id) in (SELECT rtrim(USER_ID) FROM am.MEMBERS@am WHERE RULE_ID IN ('107.001'));insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(10001,20000)),1800045,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and a.user_id in (SELECT USER_ID FROM am.MEMBERS@am WHERE RULE_ID IN ('107.002'))and a.user_id not in(select distinct user_id from am.vendermfactuser@am WHERE operater_mk = 'Y' AND red_mk = 'N'AND user_id IN(SELECT user_id FROM tanjo_data)) ;insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(2001,3000)),1800046,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and a.user_id in (SELECT USER_ID FROM am.MEMBERS@am WHERE RULE_ID IN ('107.004'));insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(3001,4000)),1800047,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and a.user_id in (SELECT USER_ID FROM am.MEMBERS@am WHERE RULE_ID IN ('107.005'));insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(10001,2000)),1800048,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and a.user_id in (SELECT USER_ID FROM am.MEMBERS@am WHERE RULE_ID IN ('107.009001'));insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(5001,6000)),1800155,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and a.user_id in (SELECT USER_ID FROM am.MEMBERS@am WHERE RULE_ID IN ('107.009002'));insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(6001,7000)),1800157,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and a.user_id in (SELECT USER_ID FROM am.MEMBERS@am WHERE RULE_ID IN ('107.009003'));insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(8001,9000)),1800156,a.pwf_user_id,181241,'20130625' from tanjo_data a,am.userm@am b where a.user_id= b.user_id and a.user_id in (SELECT USER_ID FROM am.MEMBERS@am WHERE RULE_ID IN ('107.009009'));insert into pfs_usergrouprel(usergrouprel_id,usergroup_id,user_id,add_id,add_date) select round(dbms_random.value(8001,9000)),1800164,aa.user_id,181241,'20130625' from (select distinct user_id from am.vendermfactuser@am WHERE operater_mk = 'Y' AND red_mk = 'N'AND user_id IN(SELECT user_id FROM tanjo_data)) aacommit;select distinct user_id from am.vendermfactuser@am WHERE operater_mk = 'Y' AND red_mk = 'N'AND user_id IN(SELECT user_id FROM tanjo_data)/*107.001          下單人員   1800044107.002          接單人員   1800045 107.004          採購方查詢人員  1800046 107.005          供應商查詢人員  1800047107.009001       出貨人員       1800048107.009002       財務人員       1800155      107.009003       扣款單簽核人員  1800157107.009009       生管人員        1800156     */SELECT COUNT(*) FROM USERMSELECT * FROM PROCESSINGSSELECT * FROM RULES WHERE RULE_PID LIKE '107%' ORDER BY RULE_ID--purCREATE TABLE USER_PUR AS SELECT USER_ID,LOGIN_NAME,USER_NAME,USER_ENAME,USER_SEX,USER_PWD,FACT_NO,USER_EMAIL,USER_TEL,P_NO,IKEY,DIR,FILE1ID,FILE2ID FROM USERM WHERE  CHK_MK='Y' AND (STOP_MK IS NULL OR STOP_MK!='Y') AND USER_ID IN (SELECT USER_ID FROM MEMBERS WHERE RULE_ID IN ('107.001','107.004'))select * from members where user_id in (71)--supCREATE TABLE USER_SUPPLY AS SELECT USER_ID,LOGIN_NAME,USER_NAME,USER_ENAME,USER_SEX,USER_PWD,FACT_NO,USER_EMAIL,USER_TEL,P_NO,IKEY,DIR,FILE1ID,FILE2ID  FROM USERM WHERE CHK_MK='Y' AND (STOP_MK IS NULL OR STOP_MK!='Y') AND USER_ID IN (SELECT USER_ID FROM MEMBERS WHERE RULE_ID IN ('107.002','107.005','107.009001','107.009002','107.009003','107.009009'))SELECT USER_ID,LOGIN_NAME,USER_NAME,USER_ENAME,USER_SEX,USER_PWD,FACT_NO,USER_EMAIL,USER_TEL,P_NO,IKEY,DIR,FILE1ID,FILE2ID  FROM USERM WHERE CHK_MK='Y' AND (STOP_MK IS NULL OR STOP_MK!='Y') AND USER_ID IN (SELECT USER_ID FROM MEMBERS WHERE RULE_ID IN ('107.002'))COMMITSELECT * FROM USER_SUPPLYSELECT * FROM USER_PUR

转载于:https://my.oschina.net/raydchang/blog/152287

你可能感兴趣的文章
图书清单(看不完的电子书啊)
查看>>
Btrace
查看>>
瘦AP的初始化配置
查看>>
ONOS白皮书下篇之ONOS价值主张
查看>>
VSAN API 探索第 4 部分 – VSAN 磁盘映射
查看>>
从CALSSPATH加载properties文件
查看>>
asp.net GridView激发了未处理的事件“PageIndexChanging”的分析
查看>>
MPLS
查看>>
tar.xz文件如何解压
查看>>
jquery 给textarea赋值,firefox下出现[object XMLDocument]
查看>>
我的友情链接
查看>>
2014年首届CCF软件能力认证试题 题目二
查看>>
c语言数据类型汇总
查看>>
部署Exchange 2010(二)首台MailBox服务器
查看>>
用好这块风水宝地--开博之语
查看>>
Jquery插件开发
查看>>
产品配置管理相关通知
查看>>
数据库相关算法 之 xxHash
查看>>
牛顿法/递归法实现开方的函数功能
查看>>
手势模型和Angular Material的实现
查看>>