Home >Database >Mysql Tutorial >MySQL判断临时表是否存在,不存在就创建

MySQL判断临时表是否存在,不存在就创建

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:56:453204browse

CREATE TEMPORARY table IF NOT EXISTS alarmLeveltb ( devID bigint not null, alarmLevel bigint not null );truncate

CREATE TEMPORARY table IF NOT EXISTS alarmLeveltb
 (    devID bigint not null,
      alarmLevel bigint not null
 );

truncate TABLE alarmLeveltb;--清空表中的数据

其中:alarmLeveltb为临时表的名称。

           小括号内的是该临时表的定义。

功能:判断临时表alarmleveltb是否存在,,若不存在则创建临时表alarmLeveltb。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn