<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic full join two tables using a third? in The Watercooler</title>
    <link>https://community.developer.cybersource.com/t5/The-Watercooler/full-join-two-tables-using-a-third/m-p/79994#M290</link>
    <description>&lt;P class=""&gt;I asked a similar question two days ago, but after trying to find out how to do what I wanted to do for about three hours yesterday, I stopped and decided to ask for help, because I really don't know why it doesn't work.&lt;/P&gt;&lt;P class=""&gt;I am trying to join two tables using a bridge table, which is working fine for the most part. I have my first table, containing meals (table gericht), and their ID, then I have my second table (table allergen), containing allergens and their code. Now I have my bridge table (table gericht_hat_allergen gha), containing meal IDs and allergen codes.&lt;/P&gt;&lt;P class=""&gt;Not all meals from gericht have allergens, and not all allergens from allergen are used&lt;/P&gt;&lt;P class=""&gt;When I want to join the tables to simply display every meal that has any allergens and the corresponding allergens, it's working great. Same goes for selecting every meal, even those who don't have any allergens, and the reverse, so showing the full list of allergens and the meals that have allergens.&lt;/P&gt;&lt;P class=""&gt;Now, I want to join my tables in a way that allows me to see ALL meals and ALL allergens, even if they don't have any 'partners', so, like this&lt;/P&gt;&lt;P class=""&gt;meal1 | allergen 4&amp;lt;NULL&amp;gt; | allergen 5meal3 | &amp;lt;NULL&amp;gt;&lt;/P&gt;&lt;P class=""&gt;For that, I was trying to use full joins. I thought this would work:&lt;/P&gt;&lt;P class=""&gt;SELECT gericht.id as gericht, allergen.name as allergen&lt;BR /&gt;FROM gericht_hat_allergen gha&lt;BR /&gt;RIGHT JOIN gerichtON gha.gericht_id = gericht.id&lt;BR /&gt;FULL JOIN allergenON gha.code = allergen.code&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;However, PHPStorm (which I am using) says that it can't resolve 'allergen' in the first row, and I don't know why. I have already tried reading up on full joins, but to no avail.I am fairly new to SQL (started two days ago), so chances are i am just not seeing a very simple mistake, so any help is appreciated!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 22 Nov 2021 07:11:52 GMT</pubDate>
    <dc:creator>KemarRoach</dc:creator>
    <dc:date>2021-11-22T07:11:52Z</dc:date>
    <item>
      <title>full join two tables using a third?</title>
      <link>https://community.developer.cybersource.com/t5/The-Watercooler/full-join-two-tables-using-a-third/m-p/79994#M290</link>
      <description>&lt;P class=""&gt;I asked a similar question two days ago, but after trying to find out how to do what I wanted to do for about three hours yesterday, I stopped and decided to ask for help, because I really don't know why it doesn't work.&lt;/P&gt;&lt;P class=""&gt;I am trying to join two tables using a bridge table, which is working fine for the most part. I have my first table, containing meals (table gericht), and their ID, then I have my second table (table allergen), containing allergens and their code. Now I have my bridge table (table gericht_hat_allergen gha), containing meal IDs and allergen codes.&lt;/P&gt;&lt;P class=""&gt;Not all meals from gericht have allergens, and not all allergens from allergen are used&lt;/P&gt;&lt;P class=""&gt;When I want to join the tables to simply display every meal that has any allergens and the corresponding allergens, it's working great. Same goes for selecting every meal, even those who don't have any allergens, and the reverse, so showing the full list of allergens and the meals that have allergens.&lt;/P&gt;&lt;P class=""&gt;Now, I want to join my tables in a way that allows me to see ALL meals and ALL allergens, even if they don't have any 'partners', so, like this&lt;/P&gt;&lt;P class=""&gt;meal1 | allergen 4&amp;lt;NULL&amp;gt; | allergen 5meal3 | &amp;lt;NULL&amp;gt;&lt;/P&gt;&lt;P class=""&gt;For that, I was trying to use full joins. I thought this would work:&lt;/P&gt;&lt;P class=""&gt;SELECT gericht.id as gericht, allergen.name as allergen&lt;BR /&gt;FROM gericht_hat_allergen gha&lt;BR /&gt;RIGHT JOIN gerichtON gha.gericht_id = gericht.id&lt;BR /&gt;FULL JOIN allergenON gha.code = allergen.code&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;However, PHPStorm (which I am using) says that it can't resolve 'allergen' in the first row, and I don't know why. I have already tried reading up on full joins, but to no avail.I am fairly new to SQL (started two days ago), so chances are i am just not seeing a very simple mistake, so any help is appreciated!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 22 Nov 2021 07:11:52 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/The-Watercooler/full-join-two-tables-using-a-third/m-p/79994#M290</guid>
      <dc:creator>KemarRoach</dc:creator>
      <dc:date>2021-11-22T07:11:52Z</dc:date>
    </item>
  </channel>
</rss>

