我们在做某些操作时可能会需要判断数据库表是否存在,sql语句为:
select count(1) from user_tables t where t.table_name = ‘+tableName+’;
顺便说一个备份表的sql语句:
Create table tablename_new as select * from tablename;
修改user表中name_字段把其中含有‘死’的都改成‘思’的sql语句:
update user t set t.name_ = replace(t.name_,'死','思');
select count(1) from user_tables t where t.table_name = ‘+tableName+’;
顺便说一个备份表的sql语句:
Create table tablename_new as select * from tablename;
修改user表中name_字段把其中含有‘死’的都改成‘思’的sql语句:
update user t set t.name_ = replace(t.name_,'死','思');