Database view beween cmdb_ci table with other tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 11:09 AM
Hi,
I am trying to build database view between "cmdb_ci" table with "cmdb_ci_business_app", "cmdb_ci_desktop_software", "cmdb_rel_ci", "cmdb_ci_server"
I am stuck with what needs to be the where clause condition. I don't have exposure to CMDB tables and database view
can someone help me here please

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 12:55 PM
Hi Anvitha,
Can you detail what is that you are trying to achieve by creating a view for these table. Can you help confirm the end goal or use case once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 01:00 PM
Thanks for responding @Jaspal Singh ,
Cmdb_ci is the parent table and rest of the are child tables
We have 3 fields which in all those child tables which is not there in parent table (cmdb_ci) we want to create a report and which requires fields from parent and child tables

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 01:08 PM
Create something as below
Where clause for third row:
crel.parent=cserver.sys_id || crel.child=cserver.sys_id
You can try above similarly for remaining tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 01:50 PM
Row 3 : cmdb_rel_ci => where caluse: crel.parent=cserver.sys_id || crel.child=cserver.sys_id
Ex:
When I add row 4 : cmdb_ci_desktop_software, order: 300, prefix: cidesk, => where clause: cidesk.parent=crel.sys_id || cidesk.child=crel.sys_id ?? Is the understanding correct please do let me know