title: SQL for "category" and "item" table
body: <p>I have 2 table, 1) Category Table &amp; 2) Item Table</p>
  
  <p>Category table fields are: 1) cat_id 2) cat_name
  Item table fields are: 1) cat_id 2) item_id 3) item_name</p>
  
  <p>Category Table Data:</p>
  
  <pre><code>|1|Cat A|
  |2|Cat B|
  |3|Cat C|
  </code></pre>
  
  <p>Item Table Data:</p>
  
  <pre><code>|NULL|1|Item 1|
  |1|2|Item 2|
  |NULL|3|Item 3|
  |2|4|Item 4|
  |2|5|Item 5|
  </code></pre>
  
  <p>My desired sql out put must be like: (Show all Null category item, but "distinct" item for multiple category"</p>
  
  <pre><code>|NULL|1|Item 1|
  |1|2|Item 2|
  |NULL|3|Item 3|
  |2|4|Item 4|
  </code></pre>
  
  <p>And also want to like: (Random if multiple "Item" in same category)</p>
  
  <pre><code>|NULL|1|Item 1|
  |1|2|Item 2|
  |NULL|3|Item 3|
  |2|4|Item 4|
  </code></pre>
  
  <p>&amp;</p>
  
  <pre><code>|NULL|1|Item 1|
  |1|2|Item 2|
  |NULL|3|Item 3|
  |2|5|Item 5|
  </code></pre>
  
  <p>How I can solve it? Database may "MySQL" and "SQLite" both for mobile end.</p>