How can I combine two tables with database view

Community Alums
Not applicable

What I have to do is a report that shows me all the removal candidates that are approved by the user, so I am combining the approval_approve that have a document_id equal to the id of the removal candidate
Database View

JEDMM_0-1708627188687.png

 

Approval view table

JEDMM_1-1708627241639.png


Removal candidate view Table

JEDMM_2-1708627276796.png


and I did it like this but when I go to the report I only get one
and it doesn't even have the same sys_id as the document_id

 

 



2 REPLIES 2

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Community Alums ,

 

Can u try removing view fields values from both tables as shown in screenshot 2 & 3 then try viewing the data whether it shows as expected or not.

 

Thanks,

Danish

Sumanth16
Kilo Patron

Hi @Community Alums ,

 

Using DATABASE VIEW you can combine tables.

These links will help you to accomplish your requirement

 

https://www.servicenow.com/community/developer-forum/database-views-for-beginners/m-p/1486246

https://www.servicenow.com/community/itsm-forum/database-view-joined-tables-shows-multiple-same-results/m-p/510308

https://www.servicenow.com/community/in-other-news/database-views-left-joins-and-filters-video/ba-p/2272317

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,
Sumanth Meda