Search
 
SCRIPT & CODE EXAMPLE
 

SQL

json extract

+----+--------+-------+-------+---------------------------------+
| id | name   | price | stock | attr                            |
+----+--------+-------+-------+---------------------------------+
|  2 | Shirt  | 10.50 |    78 | {"size": 42, "colour": "white"} |
|  3 | Blouse | 17.00 |    15 | {"colour": "white"}             |
+----+--------+-------+-------+---------------------------------+
  
SELECT name FROM clothes WHERE JSON_EXTRACT(attr, '$.size') = 42;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql change date format 
Sql :: mysql decimal allow negative values? 
Sql :: Create table Statement Syntax in SQL Server 
Sql :: rename table column name in mysql 
Sql :: csv into data postgres 
Sql :: how to enable mysql 5.7 root user password on linux 
Sql :: create delete procedure mysql 
Sql :: postgresql not case sensitive where in 
Sql :: creating index in mysql 
Sql :: postgressql uuid 
Sql :: delete a temporary table mysql 
Sql :: sql reverse order of results 
Sql :: sql select count distinct 
Sql :: host 127.0 0.1 is not allowed to connect to this mysql server 
Sql :: Write an SQL query to print details of the Workers who have joined in Feb’2014 
Sql :: mariadb date equals to current_date plus days 
Sql :: default number in sql 
Sql :: how to import pymysql through jupyter notebook for windows 
Sql :: sql period overlap 
Sql :: FIND AVERAGE SALARY EARNER IN SQL 
Sql :: drop schema sql 
Sql :: sql integer to serial 
Sql :: sql server list database 
Sql :: Syntax error or access violation: 1701 Cannot truncate a table referenced in a foreign key constraint 
Sql :: declare table variable sql 
Sql :: SQL COUNT() with WHERE 
Sql :: mysql case when in select 
Sql :: postgresql in array 
Sql :: select last n rows mysql 
Sql :: sql server management studio reset cache 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =