INSERT INTO ry_useraccount
(
'Id',
'UserId',
'FreeAmount',
'PayFrozenAmount',
'WithdrawFrozenAmount',
'CurrentAsset',
'CreateTime',
'UpdateTime'
) VALUES
(
'1',
'52501',
'600',
'0',
'0',
'0',
NOW(),
NOW()
);
如果只看sql,它是正确的,但是当我运行它时,导航显示
" [SQL]INSERT INTO ry_useraccount('Id', 'UserId', 'FreeAmount','PayFrozenAmount', 'WithdrawFrozenAmount', 'CurrentAsset',"CreateTime"、"UpdateTime")值(' 1 ',' 52501 ',' 600 ',' 0 ',' 0 ',' 0 ',现在(),());[Err] 1064 -你的SQL语法有错误;请查看与MySQL服务器版本对应的手册在"Id","UserId","FreeAmount"附近使用正确的语法,'PayFrozenAmount', 'WithdrawFrozenAmount', ' current ' at line 1 "
。我找不到原因。我猜可能是一些空白造成的结果,但在我删除所有的空白后,它仍然没有工作
单引号用于字符串文本而不是列名(如果您需要列名带有空格或保留字,则可以使用反引号)
INSERT INTO ry_useraccount(Id, UserId, FreeAmount, PayFrozenAmount, WithdrawFrozenAmount, CurrentAsset, CreateTime, UpdateTime)
VALUES(1, 52501, 600, 0, 0, 0, NOW(), NOW());