MySQL判断临时表是否存在,不存在就创建
来源:懂视网
责编:小采
时间:2020-11-09 12:18:30
MySQL判断临时表是否存在,不存在就创建
MySQL判断临时表是否存在,不存在就创建: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 alarm
导读MySQL判断临时表是否存在,不存在就创建: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 alarm
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。
MySQL判断临时表是否存在,不存在就创建
MySQL判断临时表是否存在,不存在就创建: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 alarm