title: How to join the same table with multiple ids?
body: <p>My goals is to <code>JOIN</code> a table multiple times on the same <code>id</code>.</p>
  <p>Here is a snipet of my database structure:</p>
  <pre><code>+---------------+--------------+-----------------------------------------+----------+-------+-----------+-----------+---------------+
  | wochenplan_id | wochentag_id | gericht                                 | kalorien | preis | kategorie | kategorie | inhaltsstoffe |
  +---------------+--------------+-----------------------------------------+----------+-------+-----------+-----------+---------------+
  |           319 |           11 | Käse - Lauch - Suppe                    |     NULL |  2.50 | NULL      | NULL      | g,i           |
  |           320 |           12 | Griechische Kartoffelpfanne             |     NULL |  2.60 | NULL      | NULL      | 10,g,i        |
  |           323 |           15 | Erbseneintopf                           |     NULL |  2.60 | NULL      | NULL      | i             |
  |           324 |           21 | Erbseneintopf mit Einlage               |     NULL |  2.60 | NULL      | NULL      | 1,2,11,i      |
  |           325 |           22 | Erbsensuppe                             |     NULL |  2.50 | NULL      | NULL      | 1,2,11,i      |
  |           326 |           23 | NULL                                    |     NULL |  NULL | NULL      | NULL      | NULL          |
  +---------------+--------------+-----------------------------------------+----------+-------+-----------+-----------+---------------+
  
  </code></pre>
  <pre><code>+--------------+-------------+
  | kategorie_id | kategorie   |
  +--------------+-------------+
  |            1 | Vegan       |
  |            2 | Vegetarisch |
  |            3 | Geflügel    |
  |            4 | Rind        |
  |            5 | Schwein     |
  |            6 | Lamm        |
  |            7 | Wild        |
  |            8 | Fisch       |
  +--------------+-------------+
  
  </code></pre>
  <p>I need to JOIN from the upper table into the <code>kategorien</code> table. I already tried some solutions here from stackoverflow but nothing is really working.</p>
  <p>Here is my query I got so far:</p>
  <pre><code>SELECT wochenplan_id, wochentag_id, gerichte.gericht, gerichte.kalorien, preise.preis, kat1.kategorie, kat2.kategorie, gerichte.inhaltsstoffe 
  FROM wochenplan 
  LEFT JOIN gerichte ON wochenplan.gericht_id = gerichte.gericht_id 
  LEFT JOIN preise ON gerichte.preis_id = preise.preis_id 
  LEFT JOIN kategorien AS kat1 ON gerichte.kategorie_id = kat1.kategorie 
  LEFT JOIN kategorien AS kat2 ON gerichte.kategorie2_id = kat2.kategorie 
  WHERE wochenplan.kw_jahr = 102021;
  </code></pre>
  <p>I alwasy get <code>NULL</code> as a result. Any ideas how to fix this problem?</p>