mysql 常用sql语句
1、增添字段
DROP PROCEDURE
IF EXISTS add_col_comment_pharmacysaleitem;
CREATE PROCEDURE add_col_comment_pharmacysaleitem ()
BEGIN
IF NOT EXISTS (
SELECT
column_name
FROM
information_schema. COLUMNS
WHERE
table_schema = DATABASE ()
AND column_name = 'Comment'
AND TABLE_NAME = 'pharmacysaleitem'
) THEN
ALTER TABLE pharmacysaleitem ADD COMMENT VARCHAR (255) NULL;
END
IF;
END;
CALL add_col_comment_pharmacysaleitem ()
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步