title: Dynamic JOIN condition
body: <p>i have table:</p>
  
  <pre><code>Tbl1
  +----+------+
  | id | type |
  +----+------+
  | 1  |  11  | 
  | 1  |  22  | 
  | 2  |  *   |
  +----+------+
  
  
  Tbl2
  +----+------+------+
  | id | type | name |
  +----+------+------+
  | 1  |  11  | AAA  |
  | 1  |  22  | BBB  |
  | 2  |  11  | CCC  |
  | 2  |  22  | DDD  |
  +----+------+------+
  </code></pre>
  
  <p>I want to JOIN ON id AND type. But if type = '*' i want get all type. 
  how to join Tbl1 and Tbl2 to achieve this result?</p>
  
  <p>Something like:</p>
  
  <pre><code>SELECT a.* FROM Tbl2 a 
  INNER JOIN Tbl1 b ON a.id = b.id  
  AND a.type = b.type ?? (i want use case statement to achieve this result)
  
  result
  +----+------+------+
  | id | type | name |
  +----+------+------+
  | 1  |  11  | AAA  |
  | 1  |  22  | BBB  |
  | 2  |  11  | CCC  |
  | 2  |  22  | DDD  |
  +----+------+------+
  </code></pre>