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.
整数データ型の列が 1 つあるテーブルがあります。文字列データ型の別の列を追加したいと考えています。
最後に、最初の列の値を 2 番目の列にコピーします。つまり、1 列目から整数データをコピーし、それを 2 列目に文字列形式でコピーしたいということです。
列を a にキャストすると、必要なことが行われCHARます。
CHAR
UPDATE `table` SET column2 = CAST(column1 AS CHAR)