日期:2014-05-16 浏览次数:20883 次
update emails_1442 tm set tm.category = 'unknown.smtp.com.cn' where lower(trim(nvl(nvl tm.category,'unknown.smtp.com.cn'))) not in (select tc.mail_category_name from EM_MAIL_CATEGORY tc);
update emails_1442 tm set tm.category = 'unknown.smtp.com.cn' where not exists (select 1 from EM_MAIL_CATEGORY tc where tc.mail_category_name = tm.category);
------解决方案--------------------
我觉得应该是这样的:
UPDATE emails_1442 tm SET tm.category = 'unknown.smtp.com.cn' WHERE to_lower(tm.category) NOT IN (SELECT to_lower(tc.mail_category_name) FROM EM_MAIL_CATEGORY tc);
------解决方案--------------------
to_lower(tc.mail_category_name)-> lower(tc.mail_category_name)
------解决方案--------------------
类似于此,当然如果是字符串的话,需要注意大小写
update emp4 e set e.deptno = 0 where not exists (select 1 from dept d where e.deptno = d.deptno)