How do I join two tables using two fields in Database View? Ex. Table1_Product+Version = Table2_Product+Version

Alex Panzarella
ServiceNow Employee
ServiceNow Employee

I think I have to use &&, but I'm unsure how to format it.

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

Hi Alex,

If the prefix for Table1 is tab1 and the prefix for Table2 is tab2 with field names 'product' and 'version' that are common to both tables, your Where clause on Table2 with order 200 would look like this:

tab1_product=tab2_product && tab1_version=tab2_version

View solution in original post

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

Hi Alex,

If the prefix for Table1 is tab1 and the prefix for Table2 is tab2 with field names 'product' and 'version' that are common to both tables, your Where clause on Table2 with order 200 would look like this:

tab1_product=tab2_product && tab1_version=tab2_version

It worked! Can't thank you enough!

Adam Stout
ServiceNow Employee
ServiceNow Employee

The documentation explains how to do both ANDs (&&) and ORs (||).  https://docs.servicenow.com/csh?version=latest&topicname=c_UseDisjunctionsInComplexQueries