Need help with a database view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 05:01 PM
I'm thinking this is not possible, because i'm hoping to get an outside join, but here we go. I'd like to create a join that shows all records in the cmdb_ci_facilities_hardware table and join with the cmdb_ci_ups_power_eq table. There is a reference field that both share (location) but that's about the only common field and to be honest it's not always filled. There's a common group in support_group that might also be used. I'm not sure how to write the "where clause" for this, though. Any suggestions? Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 05:16 PM
Hi @Mike Foreman ,
You're right GlideQuery doesn't directly support OUTER JOINS like traditional SQL. However, you can try using nested queries and union-like logic to simulate an outer join behavior.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 07:33 PM
Hello @Mike Foreman
To include all the records of "cmdb_ci_facilities_hardware" - just check the "Left Join" field here - it will automatically add all the records from this table.
And in the second table where you are talking about conditions...
You can just add like below 👇
facilities.location == power.location
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2025 08:38 PM
please share what did you try so far along with screenshots.
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
‎04-11-2025 06:35 AM
Hi Ankur - I posted some screenshots for this issue. Thanks - Mike