`

判断表是否存在

SQL 
阅读更多
我们在做某些操作时可能会需要判断数据库表是否存在,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_,'死','思');
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics