{"id":295,"date":"2024-11-25T12:10:13","date_gmt":"2024-11-25T05:10:13","guid":{"rendered":"https:\/\/www.pgtutorial.com\/?page_id=295"},"modified":"2025-04-27T09:42:26","modified_gmt":"2025-04-27T02:42:26","slug":"postgresql-inner-join","status":"publish","type":"page","link":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/","title":{"rendered":"PostgreSQL Inner Join"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use PostgreSQL <code>INNER JOIN<\/code> to merge rows from two tables and select the matching rows<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-postgresql-inner-join-clause'>Introduction to PostgreSQL INNER JOIN clause <a href=\"#introduction-to-postgresql-inner-join-clause\" class=\"anchor\" id=\"introduction-to-postgresql-inner-join-clause\" title=\"Anchor for Introduction to PostgreSQL INNER JOIN clause\">#<\/a><\/h2>\n\n\n\n<p>In PostgreSQL, a database consists of multiple related tables. They link to each other via <a href=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-foreign-key\/\">foreign keys<\/a>.<\/p>\n\n\n\n<p>To select data from two or more tables, you use the <code>INNER JOIN<\/code> clause of the <code>SELECT<\/code> statement.<\/p>\n\n\n\n<p>Here&#8217;s the syntax for the <code>INNER JOIN<\/code> clause:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  table1.column1,\n  table2.column2,\n  ...\n<span class=\"hljs-keyword\">FROM<\/span>\n  table1\n  <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> table2 <span class=\"hljs-keyword\">ON<\/span> table1.column1 = table2.column1<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, specify the name of the first table (<code>table1<\/code>) in the <code>FROM<\/code> clause.<\/li>\n\n\n\n<li>Second, provide the name of the second table (<code>table2<\/code>) you want to merge the rows with the first table in the <code>INNER JOIN<\/code> clause.<\/li>\n\n\n\n<li>Third, use a condition to match rows from the first table (<code>table1<\/code>) with the second table (<code>table2<\/code>) in the <code>ON<\/code> clause. The condition matches rows in both tables by comparing the values of <code>column1<\/code> in <code>table1<\/code> with the values of <code>column1<\/code> in <code>table2<\/code>. Note that the condition may use other comparison operators. If you want to use multiple conditions, you can use the logical operator <code>AND<\/code> to combine them in the <code>ON<\/code> clause.<\/li>\n\n\n\n<li>Finally, list out the columns from both tables to include in the final result set in the <code>SELECT<\/code> clause.<\/li>\n<\/ul>\n\n\n\n<p>PostgreSQL evaluates the <code>FROM<\/code> clause first, then the <code>INNER JOIN<\/code> clause, and finally the <code>SELECT<\/code> clause.<\/p>\n\n\n\n<p>Here&#8217;s how PostgreSQL inner join works:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, the <code>INNER JOIN<\/code> compares values in <code>column1<\/code> of both tables.<\/li>\n\n\n\n<li>Second, merge the matching rows in an intermediate table if they are equal.<\/li>\n\n\n\n<li>Third, select the columns specified in the <code>SELECT<\/code> clause in the final result set.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='understanding-postgresql-inner-join'>Understanding PostgreSQL Inner Join <a href=\"#understanding-postgresql-inner-join\" class=\"anchor\" id=\"understanding-postgresql-inner-join\" title=\"Anchor for Understanding PostgreSQL Inner Join\">#<\/a><\/h2>\n\n\n\n<p>Suppose you want to merge rows from X and Y table using an inner join:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>X<\/code> table has two columns: <code>id <\/code>(key) and <code>x<\/code>.<\/li>\n\n\n\n<li>The <code>Y<\/code> table also has two columns: <code>id<\/code> (key) and <code>y<\/code>.<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img decoding=\"async\" src=\"https:\/\/www.pgtutorial.com\/wp-content\/uploads\/2025\/02\/x-table.svg\" alt=\"PostgreSQL inner join: Left Table\" class=\"wp-image-1951\"\/><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" src=\"https:\/\/www.pgtutorial.com\/wp-content\/uploads\/2025\/02\/y-table.svg\" alt=\"PostgreSQL inner join: Right Table\" class=\"wp-image-1952\"\/><\/figure>\n<\/div><\/div>\n<\/div>\n\n\n\n<p>The inner join includes the rows with matching values in the <code>id<\/code> columns. It does not include unmatching rows in the result set:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.pgtutorial.com\/wp-content\/uploads\/2025\/02\/postgresql-inner-join-visualization.svg\" alt=\"PostgreSQL inner join visualization\" class=\"wp-image-1953\"\/><\/figure>\n<\/div>\n\n\n<p>The following Venn diagram is another way to depict how an inner join works:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.pgtutorial.com\/wp-content\/uploads\/2025\/02\/postgresql-inner-join-Venn-diagram.svg\" alt=\"\" class=\"wp-image-1955\"\/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id='postgresql-inner-join-example'>PostgreSQL Inner Join Example <a href=\"#postgresql-inner-join-example\" class=\"anchor\" id=\"postgresql-inner-join-example\" title=\"Anchor for PostgreSQL Inner Join Example\">#<\/a><\/h2>\n\n\n\n<p>Suppose you have two tables: <code>products<\/code> and <code>brands<\/code>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> brands (\n  brand_id <span class=\"hljs-type\">INT<\/span> <span class=\"hljs-keyword\">GENERATED<\/span> <span class=\"hljs-keyword\">ALWAYS<\/span> <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-keyword\">IDENTITY<\/span> <span class=\"hljs-keyword\">PRIMARY KEY<\/span>,\n  <span class=\"hljs-type\">name<\/span> <span class=\"hljs-type\">VARCHAR<\/span>(<span class=\"hljs-number\">255<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span>\n);\n\n<span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> products (\n  product_id <span class=\"hljs-type\">INT<\/span> <span class=\"hljs-keyword\">GENERATED<\/span> <span class=\"hljs-keyword\">ALWAYS<\/span> <span class=\"hljs-keyword\">AS<\/span> <span class=\"hljs-keyword\">IDENTITY<\/span> <span class=\"hljs-keyword\">PRIMARY KEY<\/span>,\n  <span class=\"hljs-type\">name<\/span> <span class=\"hljs-type\">VARCHAR<\/span>(<span class=\"hljs-number\">100<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span>,\n  price <span class=\"hljs-type\">DECIMAL<\/span>(<span class=\"hljs-number\">10<\/span>, <span class=\"hljs-number\">2<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">NULL<\/span>,\n  brand_id <span class=\"hljs-type\">INT<\/span>,\n  <span class=\"hljs-keyword\">FOREIGN KEY<\/span> (brand_id) <span class=\"hljs-keyword\">REFERENCES<\/span> brands (brand_id)\n);\n\n<span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span>\n  brands (<span class=\"hljs-type\">name<\/span>)\n<span class=\"hljs-keyword\">VALUES<\/span>\n  (<span class=\"hljs-string\">'Apple'<\/span>),\n  (<span class=\"hljs-string\">'Samsung'<\/span>),\n  (<span class=\"hljs-string\">'Google'<\/span>) \n<span class=\"hljs-keyword\">RETURNING<\/span> *;\n\n<span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span>\n  products (<span class=\"hljs-type\">name<\/span>, price, brand_id)\n<span class=\"hljs-keyword\">VALUES<\/span>\n  (<span class=\"hljs-string\">'iPhone 14 Pro'<\/span>, <span class=\"hljs-number\">999.99<\/span>, <span class=\"hljs-number\">1<\/span>),\n  (<span class=\"hljs-string\">'iPhone 15 Pro'<\/span>, <span class=\"hljs-number\">1199.99<\/span>, <span class=\"hljs-number\">1<\/span>),\n  (<span class=\"hljs-string\">'Galaxy S23 Ultra'<\/span>, <span class=\"hljs-number\">1149.47<\/span>, <span class=\"hljs-number\">2<\/span>),\n  (<span class=\"hljs-string\">'Oppo Find Flip'<\/span>, <span class=\"hljs-number\">499.99<\/span>, <span class=\"hljs-keyword\">NULL<\/span>) \n<span class=\"hljs-keyword\">RETURNING<\/span> *;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>products<\/code> table has a foreign key column, <code>brand_id<\/code>, that links to the <code>brand_id<\/code> <a href=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-primary-key\/\">primary key<\/a> column of the <code>brands<\/code> table:<\/p>\n\n\n\n<p>The <code>brands<\/code> table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>brand_id<\/th><th>name<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>Apple<\/td><\/tr><tr><td>2<\/td><td>Samsung<\/td><\/tr><tr><td>3<\/td><td>Google<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The <code>products<\/code> table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>product_id<\/th><th>name<\/th><th>price<\/th><th>brand_id<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>iPhone 14 Pro<\/td><td>999.99<\/td><td>1<\/td><\/tr><tr><td>2<\/td><td>iPhone 15 Pro<\/td><td>1299.99<\/td><td>1<\/td><\/tr><tr><td>3<\/td><td>Galaxy S23 Ultra<\/td><td>1149.47<\/td><td>2<\/td><\/tr><tr><td>4<\/td><td>Oppo Find Flip<\/td><td>499.99<\/td><td>NULL<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The following statement uses an <code>INNER JOIN<\/code> to select the product name and price from the <code>products<\/code> table and the brand name from the <code>brands<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  products.name,\n  products.price,\n  brands.name\n<span class=\"hljs-keyword\">FROM<\/span>\n  products\n  <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> brands <span class=\"hljs-keyword\">ON<\/span> brands.brand_id = products.brand_id;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">       <span class=\"hljs-type\">name<\/span>       |  price  |  <span class=\"hljs-type\">name<\/span>\n<span class=\"hljs-comment\">------------------+---------+---------<\/span>\n iPhone <span class=\"hljs-number\">14<\/span> Pro    |  <span class=\"hljs-number\">999.99<\/span> | Apple\n iPhone <span class=\"hljs-number\">15<\/span> Pro    | <span class=\"hljs-number\">1199.99<\/span> | Apple\n Galaxy S23 Ultra | <span class=\"hljs-number\">1149.47<\/span> | Samsung<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>How the query works.<\/p>\n\n\n\n<p>First, the <code>FROM<\/code> clause examines each row from the <code>products<\/code> table.<\/p>\n\n\n\n<p>Second, the <code>INNER JOIN<\/code> clause compares the <code>brand_id<\/code> of each row in the <code>products<\/code> table with the <code>brand_id<\/code> of each row in the <code>brands<\/code> table. Since they have the same <code>brand_id<\/code>, the query will combine rows from both into an imagined table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>product_id<\/th><th>name<\/th><th>price<\/th><th>brand_id<\/th><th>brand_id<\/th><th>name<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>iPhone 14 Pro<\/td><td>999.99<\/td><td>1<\/td><td>1<\/td><td>Apple<\/td><\/tr><tr><td>2<\/td><td>iPhone 15 Pro<\/td><td>1299.99<\/td><td>1<\/td><td>1<\/td><td>Apple<\/td><\/tr><tr><td>3<\/td><td>Galaxy S23 Ultra<\/td><td>1149.47<\/td><td>2<\/td><td>2<\/td><td>Samsung<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In more detail:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Row with id 1 and 2 of the <code>products<\/code> table matches row with id 1 in the <code>brands<\/code> table.<\/li>\n\n\n\n<li>Row with id 3 in the <code>products<\/code> table matches row with id 2 of the <code>brands<\/code> table.<\/li>\n\n\n\n<li>Row with id 4 in the products table does not match any row in the <code>brands<\/code> table.<\/li>\n<\/ul>\n\n\n\n<p>Third, the <code>SELECT<\/code> clause selects the <code>name<\/code> and <code>price<\/code> columns from the <code>products<\/code> table and <code>name<\/code> columns of the <code>brands<\/code> table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>name<\/th><th>price<\/th><th>name<\/th><\/tr><\/thead><tbody><tr><td>iPhone 14 Pro<\/td><td>999.99<\/td><td>Apple<\/td><\/tr><tr><td>iPhone 15 Pro<\/td><td>1299.99<\/td><td>Apple<\/td><\/tr><tr><td>Galaxy S23 Ultra<\/td><td>1149.47<\/td><td>Samsung<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='qualifying-column-names'>Qualifying column names <a href=\"#qualifying-column-names\" class=\"anchor\" id=\"qualifying-column-names\" title=\"Anchor for Qualifying column names\">#<\/a><\/h2>\n\n\n\n<p>Since both tables <code>products<\/code> and <code>brands<\/code> have the same <code>name<\/code> and <code>brand_id<\/code> columns, we have to reference them using the following syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-built_in\">table_name<\/span>.<span class=\"hljs-built_in\">column_name<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If we don&#8217;t do so, PostgreSQL will issue an ambiguous error. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  <span class=\"hljs-type\">name<\/span>,\n  price,\n  <span class=\"hljs-type\">name<\/span>\n<span class=\"hljs-keyword\">FROM<\/span>\n  products\n  <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> brands <span class=\"hljs-keyword\">ON<\/span> products.brand_id = products.brand_id;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">column<\/span> reference \"name\" <span class=\"hljs-keyword\">is<\/span> ambiguous<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The output has two columns with the same name (<code>name<\/code>); we can use column aliases to make it more obvious:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  products.name product_name,\n  products.price,\n  brands.name brand_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  products\n  <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> brands <span class=\"hljs-keyword\">ON<\/span> brands.brand_id = products.brand_id;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?db=join&amp;q=U0VMRUNUIHByb2R1Y3RzLm5hbWUgcHJvZHVjdF9uYW1lLCBwcm9kdWN0cy5wcmljZSwgYnJhbmRzLm5hbWUgYnJhbmRfbmFtZSBGUk9NIHByb2R1Y3RzIElOTkVSIEpPSU4gYnJhbmRzIE9OIGJyYW5kcy5icmFuZF9pZCA9IHByb2R1Y3RzLmJyYW5kX2lkOw\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\">   product_name   |  price  | brand_name\n<span class=\"hljs-comment\">------------------+---------+------------<\/span>\n iPhone <span class=\"hljs-number\">14<\/span> Pro    |  <span class=\"hljs-number\">999.99<\/span> | Apple\n iPhone <span class=\"hljs-number\">15<\/span> Pro    | <span class=\"hljs-number\">1199.99<\/span> | Apple\n Galaxy S23 Ultra | <span class=\"hljs-number\">1149.47<\/span> | Samsung<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='joining-tables-with-table-aliases'>Joining tables with table aliases <a href=\"#joining-tables-with-table-aliases\" class=\"anchor\" id=\"joining-tables-with-table-aliases\" title=\"Anchor for Joining tables with table aliases\">#<\/a><\/h2>\n\n\n\n<p>Typing the same table names for every column is tedious. PostgreSQL supports temporary names for tables in a query using <em>table aliases<\/em>.<\/p>\n\n\n\n<p>Like a column alias, you can assign an alias to a table temporarily during the query execution using the following syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-built_in\">table_name<\/span> <span class=\"hljs-keyword\">AS<\/span> table_alias<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Since the <code>AS<\/code> keyword is optional, you can ignore it like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-built_in\">table_name<\/span> table_alias<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following statement joins the <code>products<\/code> table with the <code>brands<\/code> table using table aliases:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  p.name product_name,\n  p.price,\n  b.name brand_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  products <span class=\"hljs-keyword\">AS<\/span> p\n  <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> brands <span class=\"hljs-keyword\">AS<\/span> b <span class=\"hljs-keyword\">ON<\/span> b.brand_id = p.brand_id;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?db=join&amp;q=U0VMRUNUIHAubmFtZSBwcm9kdWN0X25hbWUsIHAucHJpY2UsIGIubmFtZSBicmFuZF9uYW1lIEZST00gcHJvZHVjdHMgQVMgcCBJTk5FUiBKT0lOIGJyYW5kcyBBUyBiIE9OIGIuYnJhbmRfaWQgPSBwLmJyYW5kX2lkOw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In this example, we assign <code>p<\/code> as the table alias for the <code>products<\/code> table and <code>b<\/code> as the table alias for the <code>brands<\/code> table. Then, we use these table aliases to reference the column&#8217;s names from both tables.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='the-using-syntax'>The USING syntax <a href=\"#the-using-syntax\" class=\"anchor\" id=\"the-using-syntax\" title=\"Anchor for The USING syntax\">#<\/a><\/h2>\n\n\n\n<p>If you join two tables by comparing values from the same column names using the equal operator (<code>=<\/code>), you can use the <code>USING<\/code> clause syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">SELECT<\/span> table1.column1, table2.column2, ...\n<span class=\"hljs-keyword\">FROM<\/span> table1\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> table2 <span class=\"hljs-keyword\">USING<\/span> (column1);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax, we replace the following <code>ON<\/code> clause:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">ON<\/span> table1.column1 = table2.column1<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>with the <code>USING<\/code> clause:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">USING<\/span> (column1)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For example, the following statement joins the <code>products<\/code> table with the <code>brands<\/code> table using the <code>USING<\/code> clause:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"PostgreSQL SQL dialect and PL\/pgSQL\" data-shcb-language-slug=\"pgsql\"><span><code class=\"hljs language-pgsql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  p.name product_name,\n  p.price,\n  b.name brand_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  products p\n  <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> brands b <span class=\"hljs-keyword\">USING<\/span> (brand_id);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PostgreSQL SQL dialect and PL\/pgSQL<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">pgsql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.pgtutorial.com\/playground\/?db=join&amp;q=U0VMRUNUIHAubmFtZSBwcm9kdWN0X25hbWUsIHAucHJpY2UsIGIubmFtZSBicmFuZF9uYW1lIEZST00gcHJvZHVjdHMgcCBJTk5FUiBKT0lOIGJyYW5kcyBiIFVTSU5HIChicmFuZF9pZCk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In this statement, we don&#8217;t use the <code>AS<\/code> keyword for the table aliases and use the <code>USING<\/code> clause instead of the <code>ON<\/code> clause.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>INNER JOIN<\/code> clause to merge rows from multiple tables and select the matching rows.<\/li>\n\n\n\n<li>Table aliases are temporary table names during the query execution.<\/li>\n\n\n\n<li>Use the&nbsp;<code>USING<\/code>&nbsp;syntax when two tables have the same column names, and you want to join them on those columns to make the statement more concise.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='quiz'>Quiz <a href=\"#quiz\" class=\"anchor\" id=\"quiz\" title=\"Anchor for Quiz\">#<\/a><\/h2>\n\n\n\n<p><iframe loading=\"lazy\" class=\"iframe\" src=\"\/quiz\/?quiz=inner-join\" name=\"quiz\" width=\"600\" height=\"700\"><\/iframe><\/p>\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=\"295\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/\"\n\t\t\t\tdata-post-title=\"PostgreSQL Inner 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=\"295\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/\"\n\t\t\t\tdata-post-title=\"PostgreSQL Inner 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&#8217;ll learn how to use PostgreSQL INNER JOIN to merge rows from two tables and select the matching rows<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":13,"menu_order":22,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-295","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>PostgreSQL Inner Join<\/title>\n<meta name=\"description\" content=\"In this tutorial, you&#039;ll learn how to use PostgreSQL INNER JOIN to merge rows from two tables and select the matching rows\" \/>\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.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL Inner Join\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you&#039;ll learn how to use PostgreSQL INNER JOIN to merge rows from two tables and select the matching rows\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/\" \/>\n<meta property=\"og:site_name\" content=\"PostgreSQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-27T02:42:26+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/\",\"url\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/\",\"name\":\"PostgreSQL Inner Join\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pgtutorial.com\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/x-table.svg\",\"datePublished\":\"2024-11-25T05:10:13+00:00\",\"dateModified\":\"2025-04-27T02:42:26+00:00\",\"description\":\"In this tutorial, you'll learn how to use PostgreSQL INNER JOIN to merge rows from two tables and select the matching rows\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pgtutorial.com\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/x-table.svg\",\"contentUrl\":\"https:\\\/\\\/www.pgtutorial.com\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/x-table.svg\",\"caption\":\"x table\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/postgresql-tutorial\\\/postgresql-inner-join\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pgtutorial.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PostgreSQL Tutorial\",\"item\":\"https:\\\/\\\/www.pgtutorial.com\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PostgreSQL Inner Join\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pgtutorial.com\\\/#website\",\"url\":\"https:\\\/\\\/www.pgtutorial.com\\\/\",\"name\":\"PostgreSQL Tutorial\",\"description\":\"Learn PostgreSQL from Scratch\",\"alternateName\":\"PostgreSQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pgtutorial.com\\\/?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":"PostgreSQL Inner Join","description":"In this tutorial, you'll learn how to use PostgreSQL INNER JOIN to merge rows from two tables and select the matching rows","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.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL Inner Join","og_description":"In this tutorial, you'll learn how to use PostgreSQL INNER JOIN to merge rows from two tables and select the matching rows","og_url":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/","og_site_name":"PostgreSQL Tutorial","article_modified_time":"2025-04-27T02:42:26+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/","url":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/","name":"PostgreSQL Inner Join","isPartOf":{"@id":"https:\/\/www.pgtutorial.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/#primaryimage"},"image":{"@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pgtutorial.com\/wp-content\/uploads\/2025\/02\/x-table.svg","datePublished":"2024-11-25T05:10:13+00:00","dateModified":"2025-04-27T02:42:26+00:00","description":"In this tutorial, you'll learn how to use PostgreSQL INNER JOIN to merge rows from two tables and select the matching rows","breadcrumb":{"@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/#primaryimage","url":"https:\/\/www.pgtutorial.com\/wp-content\/uploads\/2025\/02\/x-table.svg","contentUrl":"https:\/\/www.pgtutorial.com\/wp-content\/uploads\/2025\/02\/x-table.svg","caption":"x table"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-inner-join\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pgtutorial.com\/"},{"@type":"ListItem","position":2,"name":"PostgreSQL Tutorial","item":"https:\/\/www.pgtutorial.com\/"},{"@type":"ListItem","position":3,"name":"PostgreSQL Inner Join"}]},{"@type":"WebSite","@id":"https:\/\/www.pgtutorial.com\/#website","url":"https:\/\/www.pgtutorial.com\/","name":"PostgreSQL Tutorial","description":"Learn PostgreSQL from Scratch","alternateName":"PostgreSQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pgtutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":16,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/295\/revisions"}],"predecessor-version":[{"id":2587,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/295\/revisions\/2587"}],"up":[{"embeddable":true,"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/pages\/13"}],"wp:attachment":[{"href":"https:\/\/www.pgtutorial.com\/wp-json\/wp\/v2\/media?parent=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}