oracle - Display one row in report by concat Inner join query -


select t.trainer_id,               t.last_name,        t.id_num,             t.language,        --t.service,        -- t.unit,        --t.rate,        (tsi.service || ' - ' || tsi.unit || ' - ' || tsi.rate) info  -- join table want 1 row display in report    lms$trainers t   inner   join trainer_service_info tsi   on t.trainer_id = tsi.trainer_id  company_id = :p0_company_id , status = 'a' 

the above code displays below results

trainer_id  name    id              lanuage             info              1000018582  twynam  5304025007080   afrikaans:english   8 - 1 - 150      1000018582  twynam  5304025007080   afrikaans:english   7 - 2 - 700      

i display

trainer_id  name    id              lanuage             info              1000018582  twynam  5304025007080   afrikaans:english   8 - 1 - 150 - 7 - 2 - 700    

with listagg

select t.trainer_id,           t.last_name,    t.id_num,         t.language,    --t.service,    -- t.unit,    --t.rate,    tsi.info  -- join table want 1 row display in report   lms$trainers t   inner   join (select trainer_id,listagg(service || ' - ' || unit || ' - ' || rate,' - ') within group (order trainer_id) info trainer_service_info group trainer_id) tsi   on t.trainer_id = tsi.trainer_id; 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -