title: SQL query to get rows contains value of another query
body: <p>I have 2 tables <code>transaction</code> and query. <code>Transaction</code> table have unique <code>tid</code> and the <code>query</code> table has <code>tid_(subtransactionid)</code>.</p>
  <p>I want to get the list of all <code>subtransactions by using tid</code>.</p>
  <p>I tried this</p>
  <pre><code>select *
  from queries, transactions
  where queries.id like 'transactions.tid%' and transactions.uid = 'NfPgWM1igYh2y2hDKrLWLOxyI6u1'
  </code></pre>