Я пытаюсь объединить некоторые таблицы в своей базе данных, но обнаружил ошибку ..
Я использую Postgresql-9.6
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;
Я ожидал, что данные, содержащие только идентификатор клиента изbasic_account и customer_pedal.
Вот таблицы структуры