I have created a table using the dynamic columns feature in MariaDB:
CREATE TABLE items
(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(100) NOT NULL,
attributes BLOB);
INSERT INTO items (name, attributes) VALUES
('T-shirt', COLUMN_CREATE('color', 'blue', 'size', 'XL', 'price' '30.0'));
The dynamic column contains the columns color
, size
and price
. How would I rename, for instance, the column price
to amount
, while actually retaining this column's content? I know about COLUMN_ADD
and COLUMN_DELETE
, but I haven't seen a COLUMN_RENAME
function. Is there a way to do this?
我的猜测是,您将必须使用COLUMN_ADD
然后使用COLUMN_DELETE
以不同的名称重新添加相同的列数据,然后从动态列中删除先前的列名称。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.