How to write DROP TABLE in different databases

How to write DROP TABLE in different databases

How to write DROP TABLE in different databases

1.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]

Thank you for reading, I hope it can help you, thank you for your support of this site!

<<:  Detailed steps to install Anaconda on Linux (Ubuntu 18.04)

>>:  How to implement responsive layout in vue-cli

Recommend

Understand CSS3 Grid layout in 10 minutes

Basic Introduction In the previous article, we in...

Float and Clear Float in Overview Page

1. Float: The main purpose is to achieve the effe...

Eclipse configures Tomcat and Tomcat has invalid port solution

Table of contents 1. Eclipse configures Tomcat 2....

Full analysis of MySQL INT type

Preface: Integer is one of the most commonly used...

Some suggestions on Vue code readability

Table of contents 1. Make good use of components ...

The big role of HTML meta

There are two meta attributes: name and http-equiv...

Modify the jvm encoding problem when Tomcat is running

question: Recently, garbled data appeared when de...

Detailed explanation of CSS elastic box flex-grow, flex-shrink, flex-basis

The functions of the three attributes flex-grow, ...

Web design must also first have a comprehensive image positioning of the website

⑴ Content determines form. First enrich the conten...

WeChat applet implements simple chat room

This article shares the specific code of the WeCh...

Nginx reverse proxy forwards port 80 requests to 8080

Let's first understand a wave of concepts, wh...

Installation tutorial of mysql 8.0.11 compressed version under win10

This article shares the installation tutorial of ...