------解决方案-------------------- 关联 系统表,实例sql如下。看看 select * information_schema.TABLES where table_schema='test' and table_name='test';
------解决方案--------------------
SQL code
create procedure sp()
begin
if exists(select 1 information_schema.TABLES where table_schema='test' and table_name='test') then
insert into test values(1);
end if;
end;
------解决方案--------------------
SQL code
create procedure sp()
begin
if exists(select 1 from information_schema.TABLES where table_schema='test' and table_name='test') then
insert into test values(1);
end if;
end;
------解决方案-------------------- 建议重新考虑你的数据库设计,这种分表设计都少见。