Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在广泛研究 concat 函数,但在创建临时表时遇到了困难。我有两列:ID(例如 4323)和来源(例如 PHI)。我想在 ID 列中添加一个包含“API-”前缀的列(例如 API-4332)。任何人有任何见解?
所有行?
UPDATE TheTable SET id = 'API-'||id;
或者,
UPDATE TheTable SET id = CONCAT('API-',id);
编辑:
您的问题陈述使我相信您想创建一个新列(“我想添加一个列......”)。对困惑感到抱歉。我已更改答案以更新 ID 列。