title: MySql Inner join where data not available there but want to give condition on it
body: <p>This is my tabel, relation with dependent </p>
  
  <blockquote>
    <p>Table: <strong>data</strong></p>
  </blockquote>
  
  <pre><code>+---------+--------------+---------------+--------------+
  | nama    | id_propinsi  | id_kabupaten  | id_kecamatan |
  +---------+--------------+---------------+--------------+
  | A       | 12           | 11            | 01           |
  +---------+--------------+---------------+--------------+
  | B       | 13           | 01            | 01           |
  +---------+--------------+---------------+--------------+
  | C       | 12           | 11            | 00           |
  +---------+--------------+---------------+--------------+
  </code></pre>
  
  <blockquote>
    <p>Table: <strong>propinsi</strong></p>
  </blockquote>
  
  <pre><code>+--------------+---------------+
  | id_propinsi  | nama_propinsi |
  +--------------+---------------+
  | 12           | jawa barat    |
  +--------------+---------------+
  | 13           | jawa timur    |
  +--------------+---------------+
  </code></pre>
  
  <blockquote>
    <p>Table: <strong>kabupaten</strong></p>
  </blockquote>
  
  <pre><code>+--------------+---------------+---------------+
  | id_propinsi  | id_kabupaten  | nama_kabupaten|
  +--------------+---------------+---------------+
  | 12           | 11            | depok         |
  +--------------+---------------+---------------+
  | 13           | 01            | magelang      |
  +--------------+---------------+---------------+
  </code></pre>
  
  <blockquote>
    <p>Table: <strong>kecamatan</strong></p>
  </blockquote>
  
  <pre><code>+--------------+---------------+--------------+---------------+
  | id_propinsi  | id_kabupaten  | id_kecamatan | nama_kecamatan|
  +--------------+---------------+--------------+---------------+
  | 12           | 11            | 01           | sawangan      |
  +--------------+---------------+--------------+---------------+
  | 13           | 01            | 01           | pasuruan      |
  +--------------+---------------+--------------+---------------+
  </code></pre>
  
  <p><strong>OUTPUT NOW (FALSE)</strong></p>
  
  <pre><code>A | Jawa barat | Depok | Sawangan 
  B | Jawa Timur | Magelang | Pasuruan
  </code></pre>
  
  <p><strong>I want to OUTPUT THIS (RIGHT)</strong></p>
  
  <pre><code>A | Jawa barat | Depok | Sawangan 
  B | Jawa Timur | Magelang | Pasuruan
  C | Jawa barat | Depok | -
  </code></pre>
  
  <p>I try to many querys but still cant get the right condition, with CASE, INNER JOIN OR .. 
  <strong>because id_kecamatan=00 unavailable on table kecamatan</strong>
  may you know how to do it to output like that i want .. ???
  Thank you so much</p>
  
  <p>my query is </p>
  
  <pre><code>SELECT name, nama_propinsi, nama_kabupaten, nama_kecamatan FROM data D
  INNER JOIN propinsi P ON D.id_propinsi=P.id_propinsi
  INNER JOIN kabupaten K ON D.id_propinsi=P.id_propinsi AND D.id_kabupaten=K.id_kabupaten
  INNER JOIN kecamatan C ON D.id_propinsi=P.id_propinsi AND D.id_kabupaten=K.id_kabupaten AND D.id_kecamatan=C.id_kecamatan
  </code></pre>