MYSQL virtual column

Sometimes in order to facilitate retrieval, some virtual columns will be built to assist us in querying, as follows: split a virtual column named client_sv from a field (json) of type text.

ALTER TABLE ot_device ADD COLUMN client_sv VARCHAR(50) AS (json_unquote(json_extract(attributes,’$.client.sv’))) VIRTUAL;

Guess you like

Origin blog.csdn.net/huangdi1309/article/details/103970687