title: How to fix 'Column Reference X is ambiguous' error in postgresql..?
body: <p>I'm trying to join some tables in my database, but I found error..</p>
  
  <p>I using Postgresql-9.6</p>
  
  <pre><code>SELECT
      customer_id
    , (select identity_card_number from basic_customer bc where bc.customer_id = ba.customer_id ) as identitu_card_number
    , (select fullname from customer_pedal cp where cp.customer_id = ba.customer_id ) as fullname
    , customer_id
    , category_code
    , (select is_cif_active_desc from basic_customer bc where bc.customer_id = ba.customer_id ) as is_active
    , ba.account_number
    , opening_date
    , closure_date
    , currency_code
    , (SELECT balance_date FROM basic_balance bb where bb.account_number = ba.account_number )  as balance_date
    , (SELECT balance_amount FROM basic_balance bb where bb.account_number = ba.account_number )  as balance_amount
    , (select description from customer_pedal cp where cp.customer_id = ba.customer_id ) as description
  FROM basic_account ba
  INNER JOIN customer_pedal cp on cp.customer_id = ba.customer_id
  WHERE ba.customer_id is not  null;
  </code></pre>
  
  <p>I expected data where contain only customer id from basic_account and customer_pedal.</p>
  
  <p>Here is the structure tables
  <a href="https://i.stack.imgur.com/p4Glw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p4Glw.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/2qeha.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2qeha.png" alt="enter image description here"></a></p>