求教mysql中if exists 的用法
展开全部
只能在SP中使用
DELIMITER $$
CREATE PROCEDURE gg()
BEGIN
IF EXISTS(SELECT column_name FROM information_schema.columns WHERE table_schema='test' AND table_name='t_user' AND column_name='point' ) THEN
SELECT 'tt';
END IF;
END$$
DELIMITER ;
DELIMITER $$
CREATE PROCEDURE gg()
BEGIN
IF EXISTS(SELECT column_name FROM information_schema.columns WHERE table_schema='test' AND table_name='t_user' AND column_name='point' ) THEN
SELECT 'tt';
END IF;
END$$
DELIMITER ;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询