- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2025 04:55 AM
Good day.
Would like to create a database view for the following condition. Please help on how to check "NOT In" in database views.
- Want to get list of products from sn_apm_trm_standards_product (t) that are not in cmdb_software_product_model (c).
- t.product not in c.product
The NOT in condition is not working in database view. Please help.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 12:15 AM
Team,
I could get left join for sn_apm_trm_standards_product table (i.e., all records from sn_apm_trm_standards_product irrespective of its match with other 2 tables) by marking left= true for other 2 tables as follows - It is bit strange though as marking Left=true for other 2 tables provides the left join output for table marked as Left = False.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2025 05:19 AM
Can you share what you already have and also what the requirement is? Because you need something common to show a record in a db view.
Maybe a report with a related list condition can do the trick,
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2025 05:59 AM
database view is used to join 2 tables based on some common fields etc
Example left join in creating a database view
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2025 08:00 AM
Thanks for the responses.
Making Left join for sn_apm_trm_standards_product (t) is not working. Keeping either of the tables as left always providing response considering cmdb_software_product_model as left. Also, the left join is working when we keep the order sequence as same in both the tables. Tried the same where clause in both. The output remains the same. When the sequence is same, left join works only considering cmdb_software_product_model as left irrespective of which ever table we mark as left. When the sequence is different, left join is not working.
Please comment on this scenario.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 12:15 AM
Team,
I could get left join for sn_apm_trm_standards_product table (i.e., all records from sn_apm_trm_standards_product irrespective of its match with other 2 tables) by marking left= true for other 2 tables as follows - It is bit strange though as marking Left=true for other 2 tables provides the left join output for table marked as Left = False.
Thanks