Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Need help with a database view

Mike Foreman
Tera Contributor

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!

8 REPLIES 8

@Mike Foreman 

you should use single = and not == to compare

so where clause should be this

fac_location=pdu_location

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Mike Foreman
Tera Contributor

MikeForeman_0-1744244063098.png

1. Here is the dbv form with the two tables i want to join

 

MikeForeman_1-1744244144879.png

2. here is the first view table form (facility hardware)

 

MikeForeman_2-1744244208367.png

3. here is the second view table form (PDU)

 

MikeForeman_3-1744244270413.png

4. here is the error message

Hi @Mike Foreman ,

Update the where clause

fac_location=pdu_location

 

if you want to add additional filters with support_gruoup, you can do that

(assuming backend name of support group is support_group in both the tables feel free to replace it if it's different)

 

fac_location=pdu_location && fac_support_group = pdu_support_group

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

@Mike Foreman 

you should use single = and not == to compare

so where clause should be this

fac_location=pdu_location

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader