title: showing null rows using join
body: <p>In mysql i m selecting from a table shouts 
  having a foreign key to another table named "roleuser" 
  with the matching column as <strong>user_id</strong></p>
  
  <p><strong>Now the user_id column in the shouts table for some rows is null</strong>
  (not actually null but with no inserts in mysql)</p>
  
  <p>How to show all the rows of the shouts table either with user_id null or not</p>
  
  <p>I m executing the sql statement</p>
  
  <pre><code>SELECT s.*, r.firstname, r.lastname
  FROM shouts s left join roleuser r where r.user_id = s.user_id limit 50;
  </code></pre>
  
  <p>which does not executes and shows</p>
  
  <pre><code> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where r.user_id = s.user_id limit 50' at line 2
  </code></pre>
  
  <p>but using inner join the sql executes which shows rows 
  which only have user_id values in the shouts table. the nulls are not shown.</p>
  
  <pre><code>SELECT s.*, r.firstname, r.lastname
  FROM shouts s inner join roleuser r where r.user_id = s.user_id limit 50;
  </code></pre>
  
  <p>How can i show all the rows from the shouts table and null values in the
  firstname and lastname columns where the user_id is null in the shouts table.
  If not at all possible with sql may be using stored procedures... </p>
  
  <p>Thanks</p>
  
  <p>Pradyut</p>