title: Condition to select WHICH table - SQL or SQLITE
body: <p>I have created the following tables:</p>
  
  <p>Customer table:</p>
  
  <pre><code>flag    |   cust_id |   customer
  --------------------------------
  1       |   60      |   customer1
  0       |   61      |   customer2
  0       |   62      |   customer3
  </code></pre>
  
  <p>Accounts table:</p>
  
  <pre><code>acc_id  |   cust_id |   account_name
  ------------------------------------
  1       |   62      |   account1
  2       |   63      |   account2
  3       |   62      |   account3
  4       |   62      |   account4
  </code></pre>
  
  <p>Contacts table:</p>
  
  <pre><code>con_id  |   cust_id |   contact_name
  ------------------------------------
  1       |   60      |   contact1
  2       |   60      |   contact2
  3       |   61      |   contact3
  4       |   62      |   contact4
  </code></pre>
  
  <p>I need the data by using the following condition if <code>flag ==1</code> from Customer table then I need all the rows from Accounts table else <code>flag==0</code> then I need all the rows from Contacts table. </p>
  
  <p>How to achieve this in one statement?</p>
  
  <p>Could anyone help me please?</p>