{"id":1508,"date":"2013-02-02T22:28:43","date_gmt":"2013-02-03T06:28:43","guid":{"rendered":"http:\/\/www.mysqltutorial.org\/?page_id=1508"},"modified":"2023-10-28T21:26:31","modified_gmt":"2023-10-29T04:26:31","slug":"mysql-self-join","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-self-join\/","title":{"rendered":"MySQL Self Join"},"content":{"rendered":"\n<p><strong>Summary<em>: <\/em><\/strong>in this tutorial, you will learn how to use <strong>MySQL self join<\/strong> which joins a table to itself using the inner join or left join.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to MySQL Self Join<\/h2>\n\n\n\n<p>A self join allows you to join a table to itself. Since MySQL does not have specific self join syntax, you need to perform a self join via a regular join such as <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-left-join\/\">left join<\/a> or <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-inner-join\/\">inner join<\/a>.<\/p>\n\n\n\n<p>Since you reference the same table within a single query, you need to use <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-alias\/\">table aliases<\/a> to assign the table a temporary name when you reference it for the second time.<\/p>\n\n\n\n<p>To perform a self join, you follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Alias a table: Assign each instance of the table a unique alias to differentiate between them.<\/li>\n\n\n\n<li>Specify the join condition: Define how the rows from each instance of the table should be compared. In a self join, you typically compare values in columns within the same table.<\/li>\n\n\n\n<li>Select the desired columns: specify the columns that you want to include in the final result set.<\/li>\n<\/ul>\n\n\n\n<p>In practice, you use a self join to query hierarchical data such as displaying organization structure or comparing rows within the same table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MySQL self join examples<\/h2>\n\n\n\n<p>We&#8217;ll use the <code>employees<\/code> table from the <a title=\"MySQL Sample Database\" href=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/mysql-sample-database\/\">sample database<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"163\" height=\"204\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees.png\" alt=\"MySQL Self Join - Sample table\" class=\"wp-image-8120\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees.png 163w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees-160x200.png 160w\" sizes=\"auto, (max-width: 163px) 100vw, 163px\" \/><\/figure>\n\n\n\n<p>The table <code>employees<\/code> stores not only employees&#8217; data but also the organization&#8217;s data. It uses the <code>reportsto<\/code> column to determine the manager id of an employee.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1) Performing a self join using an inner join<\/h3>\n\n\n\n<p>To obtain the entire organization structure, you can perform a self join on the <code>employees<\/code> table using the <code>employeeNumber<\/code> and <code>reportsTo<\/code> columns:<\/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\"><span class=\"hljs-keyword\">SELECT<\/span> \n    <span class=\"hljs-keyword\">CONCAT<\/span>(m.lastName, <span class=\"hljs-string\">', '<\/span>, m.firstName) <span class=\"hljs-keyword\">AS<\/span> Manager,\n    <span class=\"hljs-keyword\">CONCAT<\/span>(e.lastName, <span class=\"hljs-string\">', '<\/span>, e.firstName) <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-string\">'Direct report'<\/span>\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees e\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> employees m <span class=\"hljs-keyword\">ON<\/span> \n    m.employeeNumber = e.reportsTo\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> \n    Manager;<\/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><a class=\"sql\" href=\"https:\/\/www.mysqltutorial.org\/tryit\/query\/mysql-self-join\/#1\" target=\"_blank\" rel=\"noopener noreferrer\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"285\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/02\/MySQL-Selft-Join-Example.png\" alt=\"MySQL Selft Join Example\" class=\"wp-image-5220\" title=\"MySQL Selft Join Example\"\/><\/figure>\n\n\n\n<p>The output displays only the employees who have a manager. However, you don&#8217;t see the President because his name is filtered out due to the <code>INNER JOIN<\/code> clause.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2) Performing a self join using a left join<\/h3>\n\n\n\n<p>The President is the employee who does not have any manager or value in the <code>reportsTo<\/code> column is <code>NULL<\/code> .<\/p>\n\n\n\n<p>The following statement uses the <code>LEFT JOIN<\/code> clause instead of <code>INNER JOIN<\/code> to include the President:<\/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    <span class=\"hljs-keyword\">IFNULL<\/span>(<span class=\"hljs-keyword\">CONCAT<\/span>(m.lastname, <span class=\"hljs-string\">', '<\/span>, m.firstname),\n            <span class=\"hljs-string\">'Top Manager'<\/span>) <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-string\">'Manager'<\/span>,\n    <span class=\"hljs-keyword\">CONCAT<\/span>(e.lastname, <span class=\"hljs-string\">', '<\/span>, e.firstname) <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-string\">'Direct report'<\/span>\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees e\n<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> employees m <span class=\"hljs-keyword\">ON<\/span> \n    m.employeeNumber = e.reportsto\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> \n    manager <span class=\"hljs-keyword\">DESC<\/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-self-join\/#2\" target=\"_blank\" rel=\"noopener noreferrer\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"232\" height=\"262\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/02\/MySQL-Self-Join-with-LEFT-JOIN-technique.png\" alt=\"MySQL Self Join with LEFT JOIN technique\" class=\"wp-image-5221\" title=\"MySQL Self Join with LEFT JOIN technique\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">3) Using a self join to compare successive rows within the same table<\/h3>\n\n\n\n<p>By using the MySQL self join, you can display a list of customers who are located in the same city by joining the <code>customers<\/code> table to itself.<\/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    c1.city, \n    c1.customerName, \n    c2.customerName\n<span class=\"hljs-keyword\">FROM<\/span>\n    customers c1\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> customers c2 <span class=\"hljs-keyword\">ON<\/span> \n    c1.city = c2.city\n    <span class=\"hljs-keyword\">AND<\/span> c1.customername &gt; c2.customerName\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> \n    c1.city;<\/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-self-join\/#3\" target=\"_blank\" rel=\"noopener noreferrer\">Try It Out<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"393\" height=\"286\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/02\/MySQL-Self-Join-cutomers-located-in-the-same-city.png\" alt=\"MySQL Self Join cutomers located in the same city\" class=\"wp-image-5223\" title=\"MySQL Self Join cutomers located in the same city\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/02\/MySQL-Self-Join-cutomers-located-in-the-same-city.png 393w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2013\/02\/MySQL-Self-Join-cutomers-located-in-the-same-city-300x218.png 300w\" sizes=\"auto, (max-width: 393px) 100vw, 393px\" \/><\/figure>\n\n\n\n<p>In this example, the table <code>customers<\/code> is joined to itself using the following join conditions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"line-height: 13px;\"><code>c1.city = c2.city<\/code>&nbsp; makes sure that both customers have the same city.<\/span><\/li>\n\n\n\n<li><code>c1.customerName &gt; c2.customerName<\/code> ensures that the result does not include the same customer.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The MySQL self-join is a technique that joins a table to itself.<\/li>\n\n\n\n<li>Use table aliases and inner join or left join to perform a self join in MySQL.<\/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=\"1508\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-self-join\/\"\n\t\t\t\tdata-post-title=\"MySQL Self Join\"\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=\"1508\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-self-join\/\"\n\t\t\t\tdata-post-title=\"MySQL Self Join\"\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>In this tutorial, you will learn how to use MySQL self join to join a table to itself using join clauses.<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":174,"menu_order":18,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-1508","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 Self Join<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn how to use MySQL self join to join a table to itself using join clauses including left join and inner join.\" \/>\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-self-join\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Self Join\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to use MySQL self join to join a table to itself using join clauses including left join and inner join.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/mysql-self-join\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-29T04:26:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees.png\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/\",\"name\":\"MySQL Self Join\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/employees.png\",\"datePublished\":\"2013-02-03T06:28:43+00:00\",\"dateModified\":\"2023-10-29T04:26:31+00:00\",\"description\":\"In this tutorial, you will learn how to use MySQL self join to join a table to itself using join clauses including left join and inner join.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/employees.png\",\"contentUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/employees.png\",\"width\":163,\"height\":204},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-self-join\\\/#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 Self Join\"}]},{\"@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 Self Join","description":"In this tutorial, you will learn how to use MySQL self join to join a table to itself using join clauses including left join and inner join.","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-self-join\/","og_locale":"en_US","og_type":"article","og_title":"MySQL Self Join","og_description":"In this tutorial, you will learn how to use MySQL self join to join a table to itself using join clauses including left join and inner join.","og_url":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/","og_site_name":"MySQL Tutorial","article_modified_time":"2023-10-29T04:26:31+00:00","og_image":[{"url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees.png","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/","url":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/","name":"MySQL Self Join","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/#primaryimage"},"image":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees.png","datePublished":"2013-02-03T06:28:43+00:00","dateModified":"2023-10-29T04:26:31+00:00","description":"In this tutorial, you will learn how to use MySQL self join to join a table to itself using join clauses including left join and inner join.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/mysql-self-join\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/#primaryimage","url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees.png","contentUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2019\/08\/employees.png","width":163,"height":204},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/mysql-self-join\/#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 Self Join"}]},{"@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\/1508","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=1508"}],"version-history":[{"count":5,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/1508\/revisions"}],"predecessor-version":[{"id":11928,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/1508\/revisions\/11928"}],"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=1508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}