SQLITE:将字符串附加到主键
SQLITE: Appending string to primary key
我正在使用它来尝试将 NAME 中的值命名为 ValueOLD
UPDATE PLAYERS SET NAME = NAME + 'OLD';
但是我收到了
Execution finished with errors.
Result: UNIQUE constraint failed: PLAYERS.NAME
At line 1:
UPDATE PLAYERS SET NAME = NAME + 'OLD';
我看到一些关于插入的问题,看起来它们可以工作,但 UPDATE 或 SET 没有任何成功
在SQLite
中,||
可用于拼接。
所以尝试:
UPDATE
PLAYERS
SET
NAME = NAME || 'OLD';
The || operator is "concatenate" - it joins together the two strings
of its operands.
我正在使用它来尝试将 NAME 中的值命名为 ValueOLD
UPDATE PLAYERS SET NAME = NAME + 'OLD';
但是我收到了
Execution finished with errors.
Result: UNIQUE constraint failed: PLAYERS.NAME
At line 1:
UPDATE PLAYERS SET NAME = NAME + 'OLD';
我看到一些关于插入的问题,看起来它们可以工作,但 UPDATE 或 SET 没有任何成功
在SQLite
中,||
可用于拼接。
所以尝试:
UPDATE
PLAYERS
SET
NAME = NAME || 'OLD';
The || operator is "concatenate" - it joins together the two strings of its operands.