skip to Main Content

can't mysql generated int culumns be nullable?

using Mysql with the following table: CREATE TABLE participants ( id INT AUTO_INCREMENT PRIMARY KEY, puuid CHAR(36) NOT NULL, data JSON, project INT GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(data, '$.project'))) STORED NULL, schoolCode VARCHAR(255) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(data, '$.schoolCode'))) STORED, UNIQUE KEY…

VIEW QUESTION

Flatten JSON object in MYSQL

I have a table with 1 column and rows like - Row- {'category': ['mobiles'], 'specs': ['4g', '2gb ram']} Row- {'category': ['computer'], 'specs': ['2gb ram']} I want to flatten the data into 2 columns- category, mobiles specs, 4g specs, 2gb ram…

VIEW QUESTION

Modify column data stored as JSON

Lets say i have json column as JSON_COLUMN in which i am storing the data in below format Table structure: (2 columns only) ID - Autoincrement JSON_COLUMN - Varchar2(1000) Sample Data: ID : 1 JSON_COLUMN : [ { "Name":"Number", "Id":"PhoneNumber",…

VIEW QUESTION

How to use wildcard search by json column type in MySQL

I got three data in MySQL [{"key": "field_1", "value": "test_1"}, {"key": "field_2", "value": "test_2"}] [{"key": "field_1", "value": "1"}, {"key": "field_2", "value": "test_2"}] [{"key": "field_2", "value": "test_2"}, {"key": "field_1", "value": "test_1"}] I need to search data which include "key" = "field_1"…

VIEW QUESTION

Mysql – How to update a part of a json value

I have the following data and MySQL table : CREATE TABLE my_tbl( id INT, dataset_query longtext ); INSERT INTO my_tbl(id, dataset_query) VALUES (1, '{"database":1,"native":{"query":"SELECT * FROM view_1.device","template-tags":{}},"type":"native"}'); INSERT INTO my_tbl(id, dataset_query) VALUES (2, '{"database":1,"native":{"query":"SELECT id, name FROM view_1.request","template-tags":{}},"type":"native"}'); INSERT INTO…

VIEW QUESTION
Back To Top
Search