how to join sc_task, task_sla and sc_req_item tables

rshegde
Mega Contributor

Hi,

I need to create a report of catalog task and request item SLA. I am trying to create the database view, but getting syntax error. can someone tell me how to join sc_task, task_sla and sc_req_item tables?

Thanks,

Rajeev

4 REPLIES 4

snehabinani26
Tera Guru

HI Rajeev,



Why are you combining both the tables together with task_sla. You can create seperate db view for sc_task and task_sla and the other for sc_req_item and task_sla.


As task_sla will hold only 1 task at a time either sc_task or sc_req_item.



Let me know the exact requirement why you need to club all three


German Alvarez2
Tera Expert

Hi,



Starting at [sc_req_item], "sri"



then you have to add table: [sc_task] "st" where st_parent = sri_sys_id



And also [task_sla] "tsla" where tsla_task = st_sys_id (in the case of [task_sla] attached to [sc_task])


    or where   tsla_task = sri_sys_id   in the case of [task_sla] is attached to [sc_req_item]


Jaspal Singh
Mega Patron
Mega Patron

Hi Rajeev,



We had done something similar for HR Case, HR Task, Task SLA.



Database view created is as below:


find_real_file.png


Replace hr_case table with sc_req_item


task_sla remains the same


hr_task with sc_task



You can use the same variable prefix or get new ones created (your choice)



Thanks,


Jaspal Singh



Hit Like or Correct on the impact of response.


Sakshi14
Giga Expert

Hi Rajeev,



To join these three tables, you need to identify the common values that tie them together.



Please refer the below screenshot:


catalog_join.PNG



Please let me know if you still face any issues.



Thanks


Sakshi



P.S.: Please mark helpful/correct depending on impact.