This article mainly introduces the relevant information about how DROP TABLE is written in different databases. Friends who need it can refer to
How DROP TABLE is written in different databases.
1, in MySql
DROP TABLE IF EXISTS [table_name]
2, in Oracle:
BEGIN EXECUTE IMMEDIATE 'DROP TABLE [table_name]'; EXCEPTION WHEN OTHERS THEN NULL; END;
3, in Sql Server
IF EXISTS ( SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '[table_name]') DROP TABLE [table_name]
【Related recommendations】
2.mysql 5.7 Changing the database data storage location Detailed explanation of examples
3.Detailed explanation of the method of importing mysql big data into Navicat and reporting errors
4.Detailed explanation of examples of unlocking and locking tables in MYSQL
5.How to improve the database query speed of millions of items
The above is the detailed content of Detailed explanation of how to write SQL statements to delete tables in different databases. For more information, please follow other related articles on the PHP Chinese website!
The difference between drop and delete
What is the command to delete a column in sql
The difference between WeChat service account and official account
What is soft routing
The eight most commonly used functions in excel
what is optimization
What to do about connection error
What is the difference between j2ee and springboot