title: How to do an OR query in SQL
body: <p>I want to limit access to certain categories to users of certain organisations only.</p>
  
  <pre><code>User
  User_id, Username, Organisation_id
  
  Organisation
  Organisation_id, Org_name
  
  Category
  Category_id, Cat_name
  
  
  Category_Organisation
  Category_id, Organisation_id
  </code></pre>
  
  <p>So my query becomes something like this-</p>
  
  <pre><code>SELECT * FROM category c 
  INNER JOIN category_organisation co ON co.category_id = c.category_id 
  AND co.organisation_id = 'LOGGED_IN_USERs_ORGANISATION_ID'
  </code></pre>
  
  <p>If I were to add an exception i.e. allow some users too then I have this table</p>
  
  <pre><code>Category_user
  Category_id, User_id 
  </code></pre>
  
  <p>My questions are -</p>
  
  <ol>
  <li>How do I do an OR search here so that the query returns the categories which belong to either to a given organisation id or to given user id</li>
  <li><p>I want similar restriction for <code>Discussions</code> table. So I created ..</p>
  
  <p>Discussions</p>
  
  <p>Discussion_id, discussion_title</p>
  
  <p>Discussion_Users</p>
  
  <p>Discussion_Id, User_id</p>
  
  <p>Discussion_Organisations</p>
  
  <p>Discussion_Id, Organisation_id</p></li>
  </ol>
  
  <p>As you can see I have to create similar tables - do you think I could achieve it one main permissions table for all these products, categories, or anyother new tables?</p>