title: sub-query in a CASE expression in db2
body: <p>I'm trying to use a sub-query in a CASE expression but am failing. I'm using DB2, I work with a bank database and trying to select all clients (clients type 5) who have accounts or does not have an account.
  If they do have an active account, then I would like to display that account as a 1 column instead of 3. 
  I do realize I can do such a thing using OUTER JOIN but I rather master the CASE expression as best as I can.
  I appreciate any assistance ;)</p>
  
  <pre><code>select  internal_id, bank_num, identity_number, type_of_identity,
      country_id, activity_status
  CASE
      WHEN activity_status = 0 THEN 'INACTIVE'
      WHEN activity_status = 1 THEN (
  select  bank_num ||'-'|| branch_num||'-'|| account_num as acc 
  from    atlmn.atala021 LA02 
  where   LA02.internal_id = L100.internal_id)
      ELSE 'null'
      END activity
  from    atlmn.atal1001 L100 
  where   bank_num = 10
  and type_of_client = 5
  </code></pre>
  
  <p>I'm receiving the following error instead:</p>
  
  <blockquote>
    <p>ERROR [21000] [IBM][CLI Driver][DB2] SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES INTO statement is mre than one row. SQLSTATE=21000</p>
  </blockquote>