我正在尝试对此发表声明:
IF EXISTS (SELECT * FROM LeadCustomer WHERE FirstName = 'John' AND Surname = 'Smith') THEN
SELECT * FROM LeadCustomer WHERE FirstName = 'John' AND Surname = 'Smith';
ELSE
INSERT INTO LeadCustomer (Firstname, Surname, BillingAddress, email) VALUES ('John', 'Smith', '6 Brewery close, Buxton, Norfolk', 'cmp.testing@example.com');;
END IF;
它抛出错误:
错误:“IF”处或附近的语法错误
我发现了这个问题,但这些答案中建议的格式似乎也不起作用。想知道是否有人能告诉我为什么这不起作用?