How to create view on multiple tables

patibrahm
Kilo Contributor

Can anyone tell me how to create view with multiple tables. We have to query following four table.

Features(rm_feature)

Feature Requested Items Table(u_m2m_features_requested_items)

Requested Items(sc_req_item) and

Catalog Task (sc_task)

Requested Items Table is a related table to Feature table

Catalog Task table is related table to Requested Items Table I have created below view but it is not working.

Requested Items Table is a related table to Feature table

Catalog Task table is related table to Requested Items Table I have created below view but it is not working.

find_real_file.png

1 ACCEPTED SOLUTION

Hello,



Please find below the screenshot of left join field which can be added and set to true:


left_join.png


View solution in original post

8 REPLIES 8

Andras Kisgyorg
Kilo Guru

Hi Brahmaiah,



Did you try switching the order of your m2m and rm_feature tables?



I would try setting up the view tables list like the following,


it requires testing first to see if this returns the data you need:



- m2m table, order = 100, where clause (empty), left join: true (add "left join" field to the "view tables" list)


- rm_feature, order = 200, where clause: Featu_sys_id = Reque_u_feature, left join: true


- sc_req_item, order = 300, where clause: CT_sys_id = Reque_u_reqitem_reference_field_name_in_m2m, left join: true


- sc_task, order = 400, where clause: SC_sys_id = CT_sys_id, left join: true



Hope this helps.


Hi Andras,



Thank you very much for the reply.



This view is getting the required records with the first three statements. (But it is not getting any record when I add the 4th statement.)



find_real_file.png




find_real_file.png@


After adding 4th statement


find_real_file.pngfind_real_file.png


Hi Brahmaiah,



Thanks for getting back.


Before investigating further, can you please update your "where clause" fields and remove the "left join:true" part,


I might not be clear enough in my post above sorry, I meant to say: each view table lines have a field called "left join" which you can add to the list with the gear icon and set that "left join" field to true for each view tables.


Let's see the results afterwards.



Thanks,


Andras


Hi Andras,



Thank you very much for quick reply.



If I understand correctly, I have removed the   "left join:true" part,


I am sorry, I didn't understand the past update "where clause" fields, which fields have to be updated? Sorry for the trouble.



I just removed the "left   join:true" part and ram, didn't return any records.



Thanks,


Brahmaiah.