当前位置: 移动技术网 > IT编程>数据库>Mysql > DROP TABLE在不同数据库中的写法整理

DROP TABLE在不同数据库中的写法整理

2017年12月12日  | 移动技术网IT编程  | 我要评论

drop table在不同数据库中的写法整理

1,mysql中

drop table if exists [table_name]

2,oracle中:

begin
  execute immediate 'drop table [table_name]';
  exception when others then null;
end;

3,在sql server中

if exists (
  select table_name from information_schema.tables
  where  table_name = '[table_name]')
drop table [table_name]

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网