gpt4 book ai didi

mysql - SQL查询找不到错误

转载 作者:行者123 更新时间:2023-11-29 12:24:55 24 4
gpt4 key购买 nike

我有这个查询:

DECLARE @i int = 0
WHILE @i < 100 BEGIN
SET @i = @i + 1
INSERT INTO lottery (ticket, bought) VALUES (@i, false)
END

MySQL服务器

Error: Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECLARE @i int = 0 WHILE @i < 100 BEGIN
SET @i = @i + 1 INSERT INTO lott' at line 1

但是它说其中有错误,但没有说错误在哪里。我做错了什么?

最佳答案

你应该像这样放置第一行:

DECLARE @i int DEFAULT 0;

关于mysql - SQL查询找不到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28471814/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com