hello,
this is my sql=
" SELECT
hpn.id AS id,
hpn.psn_id,
hpn.last_name,
hpn.person_code,
hwe.pfn_code,
hwe.pfn_name,
hwe.scy_code,
hwe.scy_name,
hwe.hsy_name,
hwe.hin_id,
hpn.first_name as FIRST_NAME1
FROM
persons hpn,
(SELECT
w.hpn_id,
s.name AS scy_name,
s.code AS scy_code,
p.name AS pfn_name,
p.code AS pfn_code,
i.name AS hsy_name,
i.id as hin_id
FROM workplaces w, specialities s, professions p, INSTITUTIONS i
WHERE
(w.scy_id=s.id)AND
(w.pfn_id=p.id)AND
(w.hin_id=i.id)AND
(w.end_date IS NULL)AND
) hwe
WHERE
(hpn.id=hwe.hpn_id(+))
"
what i want is add subselect something like this (select card_number from REGISTRATION_CARDS x where (hpn.id=x.hpn_id(+)) )as card_number,
but it returns error single row query returns more than one row, because one people can have more that one card_number.
can some someone help me to write correct query please.