一 表备份与恢复语句
create table THBCRM_t_member as select * from t_member;--备份
delete from t_member; INSERT INTO t_member SELECT * FROM THBCRM_t_member; --恢复
二 查看用户名重复的用户
select u.id,u.deleted,u.user_name,u.first_name, u.last_name from users u
where u.user_name in (select t.user_name from users t group by t.user_name
having count(*) > 1) and u.deleted='0';
以后再用到很常用很实用的sql就记录在这里。
三 刚才遇到这个:
ora-00932:数据类型不一直:应为 -,但却获得CLOB
我是想用clob类型的数据和字符串去比较,就报上面的错误了,解决:用to_char()方法转换后再和字符串比较就ok啦。