Manoj_Pardeshi
asked on
Union Query
Can please somebody tell me what this Union query is doing:-
SELECtT
e.firstname,e.lastname,
(
SELECT e.employee_first_name||' '||e.employee_last_name Circuit_Designer
FROM task@asap_read t, employee@asap_read e, serv_req sr
WHERE sr.document_number = t.document_number
AND t.last_modified_userid = e.employee_number
AND t.task_type = 'VE_CORE'
AND sr.order_number = sor.RECIC_TBS_ORDER_NUMBER
UNION
SELECT u.workflow_user_name
FROM workflow_user@eods_read u
, workflow_task@eods_read t
, serv_build_main@eods_read sb
WHERE sb.workflow_job_ods_id = t.workflow_job_ods_id
AND t.acquire_by_workflow_user _ods_i = u.workflow_user_ods_id
AND t.workflow_task_name = 'Design'
AND sb.order_item_name = sor.recic_tbs_order_number
) Circuit_Designer,
s.source
FROM
employee e, switch s ......
This sub query having Union clause is returning more that one rows. Due to this the database is throwing exception,
But I am not able to understand the way the sub query is working.
SELECtT
e.firstname,e.lastname,
(
SELECT e.employee_first_name||' '||e.employee_last_name Circuit_Designer
FROM task@asap_read t, employee@asap_read e, serv_req sr
WHERE sr.document_number = t.document_number
AND t.last_modified_userid = e.employee_number
AND t.task_type = 'VE_CORE'
AND sr.order_number = sor.RECIC_TBS_ORDER_NUMBER
UNION
SELECT u.workflow_user_name
FROM workflow_user@eods_read u
, workflow_task@eods_read t
, serv_build_main@eods_read sb
WHERE sb.workflow_job_ods_id = t.workflow_job_ods_id
AND t.acquire_by_workflow_user
AND t.workflow_task_name = 'Design'
AND sb.order_item_name = sor.recic_tbs_order_number
) Circuit_Designer,
s.source
FROM
employee e, switch s ......
This sub query having Union clause is returning more that one rows. Due to this the database is throwing exception,
But I am not able to understand the way the sub query is working.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.