我在第 7 行收到语法错误 - “BEGIN” for while -
BEGIN
IF EXISTS(SELECT 1 from table1)
THEN
IF EXISTS(SELECT 1 from table2)
THEN
WHILE EXISTS(SELECT 1 FROM table3)
BEGIN
BEGIN TRANSACTION;
COMMIT TRANSACTION;
END
END IF;
END IF;
END
有什么建议或指示吗?