-3

I'm a beginner. 4 tables and result required is given below . I'm able to achieve the result partially with this query. (getting only uat date , not all 3) Please help to achieve entire result ..

Query used :

select r.request_number,r.description, r.creation_date, u.parameter29 as proposed_deployment_date, wft.approval_date as uat_date, v.parameter14 as actual_deploy_date, r.closed date from table2 u,table2 v , table1 r , table3 wft
where u.batch_number=1 and v.batch_number=3 and wft.step_id=41075 and r.request_number=u.request_number and r.request_number=v.request_number and wft.request_number = r.request_number order by r.request number;

Image1

image2

closed as unclear what you're asking by Tom V, MDCCL, Marco, Mike Walsh, Shanky Dec 9 '16 at 15:31

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

5

Typical PIVOT:

select 
  request_number,
  creation_date,
  it_approval_date,
  uat_approval_date,
  reg_approval_date,
  prod_approval_date,
  status
from
(
  select request_number, creation_date, approval_date, approval_name, status
  from table1 natural join table2
)
pivot
(
  min(approval_date) as approval_date 
  for approval_name in('IT' as it, 'UAT' as uat, 'REG' as reg, 'PROD' as prod)
)
order by request_number;

REQUEST_NUMBER CREATION_D IT_APPROVA UAT_APPROV REG_APPROV PROD_APPRO STATUS
-------------- ---------- ---------- ---------- ---------- ---------- ----------
             1 22/03/2016 24/03/2016 27/03/2016 28/03/2016 29/03/2016 completed
             2 23/03/2016 25/03/2016 26/03/2016 27/03/2016 28/03/2016 completed

Not the answer you're looking for? Browse other questions tagged or ask your own question.