{"id":13733,"date":"2023-12-29T00:26:31","date_gmt":"2023-12-29T07:26:31","guid":{"rendered":"https:\/\/www.mysqltutorial.org\/?page_id=13733"},"modified":"2023-12-29T00:26:32","modified_gmt":"2023-12-29T07:26:32","slug":"mysql-like","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/","title":{"rendered":"MySQL LIKE"},"content":{"rendered":"\n<p><strong>Summary<\/strong><em>:<\/em> in this tutorial, you will learn how to use the MySQL <code>LIKE<\/code> operator to query data based on a specified pattern.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to MySQL LIKE operator<\/h2>\n\n\n\n<p>The <code>LIKE<\/code> operator is a logical operator that tests whether a string contains a specified pattern or not. <\/p>\n\n\n\n<p>Here&#8217;s the syntax of the <code>LIKE<\/code> operator:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">expression LIKE pattern ESCAPE escape_character<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax, if the <code>expression<\/code> matches the <code>pattern<\/code>, the <code>LIKE<\/code> operator returns 1. Otherwise, it returns 0.<\/p>\n\n\n\n<p>MySQL provides two wildcard characters for constructing patterns: Percentage <code>%<\/code> and underscore <code>_<\/code> .<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The percentage ( <code>%<\/code> ) wildcard matches any string of zero or more characters.<\/li>\n\n\n\n<li>The underscore ( <code>_<\/code> ) wildcard matches any single character.<\/li>\n<\/ul>\n\n\n\n<p>For example, <code>s%<\/code> matches any string starting with the character s such as sun and six. The se_ matches any string starting with &nbsp;<code>se<\/code> and is followed by any character such as <code>see<\/code> and <code>sea<\/code>.<\/p>\n\n\n\n<p>When the pattern contains the wildcard character and you want to treat it as a regular character, you can use the <code>ESCAPE<\/code> clause.<\/p>\n\n\n\n<p>Typically, you&#8217;ll use the <code>LIKE<\/code> operator in the <code><a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-where\/\">WHERE<\/a><\/code>&nbsp;clause of the <code><a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-select-from\/\">SELECT<\/a><\/code> , <code><a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-delete\/\">DELETE<\/a><\/code>, and <code><a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-update\/\">UPDATE<\/a><\/code> statement.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL LIKE operator examples<\/h2>\n\n\n\n<p>Let\u2019s practice with some examples of using the <code>LIKE<\/code> operator. We will use the following <code>employees<\/code> table from the <a href=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/\">sample database<\/a> for the demonstration:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/employees.svg\" alt=\"\" class=\"wp-image-10759\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">1) Using MySQL LIKE operator with the percentage (%) wildcard examples<\/h3>\n\n\n\n<p>This example uses the <code>LIKE <\/code>operator to find employees whose first names start with the letter <code>a<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    employeeNumber, \n    lastName, \n    firstName\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n    firstName <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'a%'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-like\/#1\">Try It Out<\/a><\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"65\" class=\"alignnone size-full wp-image-5196\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/MySQL-LIKE-Operator-Example.png\" alt=\"MySQL LIKE Operator Example\"><br> In this example, MySQL scans the whole <code>employees<\/code> table to find employees whose first names start with the letter <code>a<\/code> and are followed by any number of characters.<\/p>\n\n\n\n<p>This example uses the <code>LIKE<\/code> operator to find employees whose last names end with the literal string <code>on<\/code> e.g., <code>Patterson<\/code>, <code>Thompson<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    employeeNumber, \n    lastName, \n    firstName\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n    lastName <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'%on'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-like\/#2\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"256\" height=\"112\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/MySQL-LIKE-operator-lastname-pattern-example.png\" alt=\"MySQL LIKE operator lastname pattern example\" class=\"wp-image-5197\"\/><\/figure>\n\n\n\n<p>To check if a string contains a substring, you can use the percentage ( <code>%<\/code> ) wildcard at the beginning and the end of the substring.<\/p>\n\n\n\n<p>For example, the following query uses the <code>LIKE<\/code> operator to find all employees whose last names contain the substring <code>on<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    employeeNumber, \n    lastName, \n    firstName\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n    lastname <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'%on%'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-like\/#3\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"257\" height=\"178\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/MySQL-LIKE-operator-with-prefix-and-suffix-patterns.png\" alt=\"MySQL LIKE operator with prefix and suffix patterns\" class=\"wp-image-5198\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2) Using MySQL LIKE operator with an underscore( _ ) wildcard examples<\/h3>\n\n\n\n<p>To find employees whose first names start with the letter&nbsp;<code>T<\/code> , end with the letter <code>m<\/code>, and contain any single character between e.g., <code>Tom<\/code> , <code>Tim<\/code>, you use the underscore (_) wildcard to construct the pattern as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    employeeNumber, \n    lastName, \n    firstName\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n    firstname <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'T_m'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-like\/#4\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"299\" height=\"46\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/mysql-like-with-_-pattern.png\" alt=\"mysql-like-with-_-pattern\" class=\"wp-image-3833\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">3) Using MySQL NOT LIKE operator example<\/h3>\n\n\n\n<p>The MySQL allows you to combine the <code>NOT<\/code> operator with the <code>LIKE<\/code> operator to find a string that does not match a specific pattern.<\/p>\n\n\n\n<p>Suppose you want to search for employees whose last names don&#8217;t start with the letter <code>B<\/code>, you can use the <code>NOT LIKE<\/code> operator as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    employeeNumber, \n    lastName, \n    firstName\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n    lastName <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'B%'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-like\/#5\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"252\" height=\"242\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/MySQL-NOT-LIKE-example-1.png\" alt=\"MySQL NOT LIKE example\" class=\"wp-image-5199\"\/><\/figure>\n\n\n\n<p class=\"note\">Note that the pattern is not case-sensitive. Therefore, the <code>b%<\/code> and <code>B%<\/code> patterns return the same result.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL LIKE operator with the ESCAPE clause<\/h2>\n\n\n\n<p>Sometimes the pattern may contain the wildcard characters e.g., 10%, _20, etc. <\/p>\n\n\n\n<p>In this case, you can use the <code>ESCAPE<\/code> clause to specify the escape character so that the LIKE operator interprets the wildcard character as a literal character. <\/p>\n\n\n\n<p>If you don&#8217;t specify the escape character explicitly, the backslash character (<code>\\<\/code>) is the default escape character.<\/p>\n\n\n\n<p>For example, if you want to find products whose product codes contain the string <code>_20<\/code> , you can use the pattern <code>%\\_20%<\/code> with the default escape character:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    productCode, \n    productName\n<span class=\"hljs-keyword\">FROM<\/span>\n    products\n<span class=\"hljs-keyword\">WHERE<\/span>\n    productCode <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'%\\_20%'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-like\/#6\">Try It Out<\/a><\/p>\n\n\n\n<p>Alternatively, you can specify a different escape character e.g., <code>$<\/code> using the <code>ESCAPE<\/code> clause:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    productCode, \n    productName\n<span class=\"hljs-keyword\">FROM<\/span>\n    products\n<span class=\"hljs-keyword\">WHERE<\/span>\n    productCode <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'%$_20%'<\/span> ESCAPE <span class=\"hljs-string\">'$'<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-like\/#7\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"317\" height=\"132\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/MySQL-LIKE-ESCAPE-example.png\" alt=\"MySQL LIKE ESCAPE example\" class=\"wp-image-5200\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/MySQL-LIKE-ESCAPE-example.png 317w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2009\/12\/MySQL-LIKE-ESCAPE-example-300x125.png 300w\" sizes=\"auto, (max-width: 317px) 100vw, 317px\" \/><\/figure>\n\n\n\n<p>The pattern <code>%$_20%<\/code> matches any string that contains the <code>_20<\/code> string.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>LIKE<\/code> operator to test if a value matches a pattern.<\/li>\n\n\n\n<li>The <code>%<\/code> wildcard matches zero or more characters.<\/li>\n\n\n\n<li>The <code>_<\/code> wildcard matches a single character.<\/li>\n\n\n\n<li>Use <code>ESCAPE<\/code> clause specifies an escape character other than the default escape character (<code>\\<\/code>).<\/li>\n\n\n\n<li>Use the <code>NOT<\/code> operator to negate the <code>LIKE<\/code> operator.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful? <\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"13733\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/\"\n\t\t\t\tdata-post-title=\"MySQL LIKE\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"13733\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/\"\n\t\t\t\tdata-post-title=\"MySQL LIKE\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: in this tutorial, you will learn how to use the MySQL LIKE operator to query data based on a specified pattern. Introduction to MySQL LIKE operator The LIKE operator is a logical operator that tests whether a string contains a specified pattern or not. Here&#8217;s the syntax of the LIKE operator: In this syntax, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":174,"menu_order":10,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-13733","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MySQL LIKE<\/title>\n<meta name=\"description\" content=\"This tutorial shows you step by step how to use the MySQL LIKE operator to query data from tables based on a specified pattern.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL LIKE\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you step by step how to use the MySQL LIKE operator to query data from tables based on a specified pattern.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-29T07:26:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/employees.svg\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/\",\"name\":\"MySQL LIKE\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/employees.svg\",\"datePublished\":\"2023-12-29T07:26:31+00:00\",\"dateModified\":\"2023-12-29T07:26:32+00:00\",\"description\":\"This tutorial shows you step by step how to use the MySQL LIKE operator to query data from tables based on a specified pattern.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/employees.svg\",\"contentUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/employees.svg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/mysql-like\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Basics\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MySQL LIKE\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\",\"name\":\"MySQL Tutorial\",\"description\":\"A comprehensive MySQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mysqltutorial.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL LIKE","description":"This tutorial shows you step by step how to use the MySQL LIKE operator to query data from tables based on a specified pattern.","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:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/","og_locale":"en_US","og_type":"article","og_title":"MySQL LIKE","og_description":"This tutorial shows you step by step how to use the MySQL LIKE operator to query data from tables based on a specified pattern.","og_url":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/","og_site_name":"MySQL Tutorial","article_modified_time":"2023-12-29T07:26:32+00:00","og_image":[{"url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/employees.svg","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/","url":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/","name":"MySQL LIKE","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/#primaryimage"},"image":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/employees.svg","datePublished":"2023-12-29T07:26:31+00:00","dateModified":"2023-12-29T07:26:32+00:00","description":"This tutorial shows you step by step how to use the MySQL LIKE operator to query data from tables based on a specified pattern.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/#primaryimage","url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/employees.svg","contentUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/10\/employees.svg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-like\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mysqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"MySQL Basics","item":"https:\/\/www.mysqltutorial.org\/mysql-basics\/"},{"@type":"ListItem","position":3,"name":"MySQL LIKE"}]},{"@type":"WebSite","@id":"https:\/\/www.mysqltutorial.org\/#website","url":"https:\/\/www.mysqltutorial.org\/","name":"MySQL Tutorial","description":"A comprehensive MySQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mysqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/13733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/comments?post=13733"}],"version-history":[{"count":2,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/13733\/revisions"}],"predecessor-version":[{"id":13735,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/13733\/revisions\/13735"}],"up":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/174"}],"wp:attachment":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/media?parent=13733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}