title: SQL Inner join two tables and extract a boolean value from second column based on condition
body: <p>I have a table like below. Lets called it <strong>Transactions</strong></p>
  <pre><code>id   scan_id   amount   date           description
  1       123      10     2020-12-01      &quot;tissue&quot;
  1       111      500    2020-12-01      &quot;amount to mexico&quot;
  1       124      15     2020-12-01      &quot;dairy product&quot;
  2       222      1000   2020-13-01      &quot;amount to India&quot;
  2       154      10     2020-13-01      &quot;dairy&quot;
  3       333      499    2020-14-01      &quot;amt to philipines&quot;
  -
  -
  -
  -
  </code></pre>
  <p>I want all transactions where scan_id in (111,222,333) along with a boolean value indicating whether a customer made any other transactions other than scan_id(111,222,333) on the same date.
  Here scan_ids (111,222,333) refers to Money Tx and others are not.
  Example required data as below</p>
  <pre><code>id   scan_id   amount   date           description            same_day_non_money_tx
  1       111      500    2020-12-01      &quot;amount to mexico&quot;        Yes
  2       222      1000   2020-13-01      &quot;amount to India&quot;         Yes
  3       333      499    2020-14-01      &quot;amt to philipines&quot;       No
  </code></pre>
  <p>I thought of doing an inner join like below</p>
  <pre><code>select id, scan_id, amount, date, description
  from transactions where scan_id in (111,222,333) as T1
  inner join 
  select id, scan_id, amount, date, description
  from transactions where scan_id not in (111,222,333) as T2
  on T1.id = T2.id
  and T1.date = T2.date
  </code></pre>
  <p>but this gives me all the transactions which matches based on id and date. How do i get this matching as a separate column?</p>