{"id":8432,"date":"2021-01-18T04:33:00","date_gmt":"2021-01-18T04:33:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8432"},"modified":"2025-09-01T05:01:50","modified_gmt":"2025-09-01T05:01:50","slug":"how-to-query-json-column-in-mysql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/","title":{"rendered":"How to Query JSON column in MySQL"},"content":{"rendered":"\n<p>JSON is a popular data exchange format used widely in websites and apps. It is also supported by many RESTful APIs. Sometimes you may need to store and search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. MySQL stores JSON as strings so these operations can be tricky. Luckily, there are several ways to do this. In this article, we will look at how to query JSON column in MySQL.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#Why_Query_JSON_in_MySQL\" >Why Query JSON in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#How_to_Query_JSON_column_in_MySQL\" >How to Query JSON column in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#How_to_Retrieve_data_from_JSON_column_in_MySQL\" >How to Retrieve data from JSON column in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#1_Using_Path_Operators\" >1. Using Path Operators<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#2_Using_json_extract_function\" >2. Using json_extract() function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#3_Using_Like_Operator\" >3. Using Like Operator<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#Extract_JSON_using_Ubiq\" >Extract JSON using Ubiq<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Query_JSON_in_MySQL\"><\/span>Why Query JSON in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>These days most websites and apps write their data as JSON strings and store them in databases, since JSON strings are structured but very flexible. But this poses a problem. Since JSON strings can have multiple nesting and varying structure it is difficult to use traditional MySQL operators to filter rows based on JSON values. Also, since each JSON entity follows the key-value format, it can be difficult to retrieve JSON value of an item using its key.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Query_JSON_column_in_MySQL\"><\/span>How to Query JSON column in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let us say you have the following table <em>users(id, details)<\/em> where <em>id<\/em> is an integer and primary key while <em>details<\/em> is a JSON data type column. The details column stores all details of users such as their OS name, web browser, resolution, etc. as a JSON string.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">create table users(\n    id int auto_increment primary key,\n    details <strong>json<\/strong>\n   );<\/pre>\n\n\n\n<p>We will insert the following JSON data in our table.<\/p>\n\n\n\n<pre id=\"block-555b1729-d13a-44c8-9829-b943ff7cb951\" class=\"wp-block-preformatted\">insert into users(details)\n    values(\n      '{ \"page\": \"\/\" , \n         \"name\": \"Safari\", \n         \"os\": \"Mac\", \n         \"spend\": [100, 50]\n         \"resolution\": { \"x\": 1920, \"y\": 1080 } }'\n),\n(\n      '{ \"page\": \"\/products\", \n         \"name\": \"Chrome\", \n         \"os\": \"Windows\", \n         \"spend\": [150, 250]\n         \"resolution\": { \"x\": 1680, \"y\": 1050 } }'\n),\n(\n     '{ \"page\": \"\/shoes\", \n        \"name\": \"Firefox\", \n        \"os\": \"Windows\", \n        \"spend\": [200,300]\n        \"resolution\": { \"x\": 1280, \"y\": 800 } }'\n);<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Retrieve_data_from_JSON_column_in_MySQL\"><\/span>How to Retrieve data from JSON column in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p> MySQL offers path operators as well as json_extract() function for this purpose. Lastly, you can search it just as you would search a string for a substring. We will look at each of these solutions one by one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_Path_Operators\"><\/span>1. Using Path Operators<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Since MySQL 5.7.8, it provides two operators ( -&gt; and -&gt;&gt; ) to extract data from JSON columns. -&gt;&gt; will get the string value while -&gt; will fetch value without quotes.<\/p>\n\n\n\n<p>Here is the SQL query to extract browser name from <em>details<\/em> column<\/p>\n\n\n\n<pre id=\"block-982cf762-9dd8-4790-8601-5c9670ce9a67\" class=\"wp-block-preformatted\">mysql&gt; select id, \n       details-&gt;&gt;'$.name' as browser_str,\n       details-&gt;'$.name' as browser_name\n       from users;\n+----+--------------+--------------+\n| id | browser_str  | browser_name |\n+----+--------------+--------------+\n|  1 | \"Safari\"     |  Safari      |\n|  2 | \"Chrome\"     |  Chrome      |\n|  3 | \"Firefox\"    |  Firefox     |\n+----+--------------+--------------+<\/pre>\n\n\n\n<p>As you can see -&gt;&gt; returns output as quoted strings, while -&gt; returns values as they are.<\/p>\n\n\n\n<p>You can also use these operators in WHERE clause as shown below.<\/p>\n\n\n\n<pre id=\"block-6999123e-c3b5-4bd9-8210-a893b1adb126\" class=\"wp-block-preformatted\">mysql&gt; select id, <br>       details-&gt;&gt;'$.name' as browser_str,<br>       details-&gt;'$.name' as browser_name<br>       from users<br>       where details-&gt;&gt;'$.name'=\"Chrome\";<br>+----+--------------+--------------+<br>| id | browser_str  | browser_name |<br>+----+--------------+--------------+<br>|  2 | \"Chrome\"     |  Chrome      |<br>+----+--------------+--------------+<\/pre>\n\n\n\n<p>If you want to retrieve <em>resolution.x<\/em> value, that is, from an object, then you can do so using the dot (.) operator, as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; select detail<code>s-&gt;'$.resolution.x'<\/code> as  width\n       from users;\n+----+-----------+\n| id |  width    |\n+----+-----------+\n|  1 | 1920      |\n|  2 | 1680      |\n|  3 | 1280      |\n+----+-----------+<\/pre>\n\n\n\n<p>Similarly, if you want to extract an array element from a JSON, then you can access them using square brackets &#8216;[ ]&#8217; and index of array element. Here is the SQL query to extract  first element of array <em>spend<\/em>.<\/p>\n\n\n\n<pre id=\"block-085c4769-29c2-4617-8564-2baf4a1de191\" class=\"wp-block-preformatted\">mysql&gt; select detail<code>s-&gt;&gt;'$.spend[0]'<\/code> as spend\n       from users;\n+----+-----------+\n| id |  spend    |\n+----+-----------+\n|  1 | 100       |\n|  2 | 150       |\n|  3 | 200       |\n+----+-----------+<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_json_extract_function\"><\/span>2. Using json_extract() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>MySQL &gt;= 5.7 features json_extract() function. Here is its syntax.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">select json_extract(json, '$.key')<br>from table<br>where json_extract(json, '$.key') = 'value'<\/pre>\n\n\n\n<p>Here is a query to get row where browser name is Chrome.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; select id, <br>       json_extract(details,'$.name') as browser_str,<br>       json_extract(details,'$.name') as browser_name<br>       from users<br>       where json_extract(details, '$.name')=\"Chrome\";<br>+----+--------------+--------------+<br>| id | browser_str  | browser_name |<br>+----+--------------+--------------+<br>|  2 | \"Chrome\"     |  Chrome      |<br>+----+--------------+--------------+<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Using_Like_Operator\"><\/span>3. Using Like Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you are using MySQL &lt; 5.7 then you will need to search your JSON column for key-value pair just as you would search for a substring in a string.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; SELECT * FROM users WHERE details LIKE '%\"name\": \"Chrome\"%';<br>+----+-----------------------------------------------------------------------------------------------------------------------------------------------------------+<br>| id | details                                                                                                                                                   |<br>+----+-----------------------------------------------------------------------------------------------------------------------------------------------------------+<br>|  2 | { \"page\": \"\/products\", \"name\": \"Chrome\",\"os\": \"Windows\", \"spend\": [150, 250]         \"resolution\": { \"x\": 1680, \"y\": 1050 } } |<br>+----+-----------------------------------------------------------------------------------------------------------------------------------------------------------+<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to extract JSON values from MySQL columns with JSON data type. Please note, MySQL &gt;=5.7.8 supports JSON data type. All prior versions store JSON as blob or texts. Similarly, since version 5.7.8, MySQL also supports path operators(-&gt; and -&gt;&gt;) as well as json_extract() function to retrieve JSON values from a json column. If you are using MySQL&lt;5.7.8, you will need to look for JSON value just as we search for substring in a text or blob column.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Extract_JSON_using_Ubiq\"><\/span>Extract JSON using Ubiq<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\">Ubiq<\/a> Reporting tool supports all the above SQL queries and makes it easy to visualize SQL results in different ways. Here is the first SQL query mentioned above, in Ubiq.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"439\" src=\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/query-json-in-ubiq-1.webp?resize=730%2C439&#038;ssl=1\" alt=\"\" class=\"wp-image-8433\"\/><\/figure>\n<\/div>\n\n\n<p>Need a reporting tool for MySQL? <a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>&nbsp;Today!<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-avoid-inserting-duplicate-records-in-mysql\/\">How to Avoid Inserting Duplicate Records in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-convert-datetime-to-utc-in-mysql\/\">How to Convert Datetime to UTC in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-convert-utc-to-local-time-in-mysql\/\">How to Convert UTC to Local Time in MySQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may need to search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. In this article, we will look at how to query JSON column in MySQL.<\/p>\n","protected":false},"author":1,"featured_media":8434,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324],"tags":[450,451,452],"class_list":["post-8432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-extract-json","tag-query-json","tag-retrieve-json"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Query JSON column in MySQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Sometimes you may need to search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. In this article, we will look at how to query JSON column in MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Query JSON column in MySQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Sometimes you may need to search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. In this article, we will look at how to query JSON column in MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-18T04:33:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-01T05:01:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/extract-json-mysql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"730\" \/>\n\t<meta property=\"og:image:height\" content=\"390\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Query JSON column in MySQL\",\"datePublished\":\"2021-01-18T04:33:00+00:00\",\"dateModified\":\"2025-09-01T05:01:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/\"},\"wordCount\":658,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/extract-json-mysql.webp?fit=730%2C390&ssl=1\",\"keywords\":[\"extract json\",\"query json\",\"retrieve json\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/\",\"name\":\"How to Query JSON column in MySQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/extract-json-mysql.webp?fit=730%2C390&ssl=1\",\"datePublished\":\"2021-01-18T04:33:00+00:00\",\"dateModified\":\"2025-09-01T05:01:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Sometimes you may need to search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. In this article, we will look at how to query JSON column in MySQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/extract-json-mysql.webp?fit=730%2C390&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/extract-json-mysql.webp?fit=730%2C390&ssl=1\",\"width\":730,\"height\":390,\"caption\":\"extract json mysql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/how-to-query-json-column-in-mysql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Query JSON column in MySQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Query JSON column in MySQL - Ubiq BI","description":"Sometimes you may need to search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. In this article, we will look at how to query JSON column in MySQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/","og_locale":"en_US","og_type":"article","og_title":"How to Query JSON column in MySQL - Ubiq BI","og_description":"Sometimes you may need to search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. In this article, we will look at how to query JSON column in MySQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2021-01-18T04:33:00+00:00","article_modified_time":"2025-09-01T05:01:50+00:00","og_image":[{"width":730,"height":390,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/extract-json-mysql.webp","type":"image\/webp"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Query JSON column in MySQL","datePublished":"2021-01-18T04:33:00+00:00","dateModified":"2025-09-01T05:01:50+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/"},"wordCount":658,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/extract-json-mysql.webp?fit=730%2C390&ssl=1","keywords":["extract json","query json","retrieve json"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/","name":"How to Query JSON column in MySQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/extract-json-mysql.webp?fit=730%2C390&ssl=1","datePublished":"2021-01-18T04:33:00+00:00","dateModified":"2025-09-01T05:01:50+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Sometimes you may need to search JSON array of objects, extract JSON data or retrieve JSON data in MySQL. In this article, we will look at how to query JSON column in MySQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/extract-json-mysql.webp?fit=730%2C390&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/extract-json-mysql.webp?fit=730%2C390&ssl=1","width":730,"height":390,"caption":"extract json mysql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-query-json-column-in-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Query JSON column in MySQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2025\/06\/extract-json-mysql.webp?fit=730%2C390&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2c0","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=8432"}],"version-history":[{"count":2,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8432\/revisions"}],"predecessor-version":[{"id":9381,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8432\/revisions\/9381"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8434"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}