title: Mysql query check whether the user was assigned
body: <p>I need a help in this query. </p>
  
  <p>A user only sees a list with a list type of complex or simple and which are assigned to his Account and no other Account.</p>
  
  <p>I have executed this query, </p>
  
  <pre><code>SELECT 
      `main`.*, `ac`.`account_id`
  FROM
      `list` AS `main`
          LEFT JOIN
      `account` AS `ac` ON ac.list_id = main.id
  WHERE
      (ac.`account_id` = '31')
          AND (`type` IN ('simple' , 'complete'))
  </code></pre>
  
  <p>but i need to check whether the list was assigned to any other account. If the list was associated to any other account id other than 31 then I should not show that list.</p>