Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Left Join in creating database view

amiegross
Mega Contributor

Hi -

I'm trying to create a database view with a left join and I'm a little confused by the results I'm getting and questioning what "Leftjoin = true" means.  

What I'm try to create would be similar to writing a SQL query:

 

Select * from sys_user as u

left join u_integration_definition as id

on u.sys_id = id.u_user

 

What I expect is all records from the sys_user table.

I thought what I built below would get the results I wanted:

find_real_file.png

but I only get integration records (table u_integration_definition).  It's not until I flip the True/ False values on the tables where I would get all sys_user records. Why is that? I assumed that by selecting LeftJoin = true on the sys_user table, the sys_user table is the left table. I am now confident I have no idea what "Left Join = true" means. 

 

Thank you!

5 REPLIES 5

Dario Marquez
Tera Expert

I am having same issue but flipping the left join box is not working. I am trying to join the 'Change Request' table with a CMDB CI table throught the 'Site ID' and I only gets records from my Change Request table where the Site ID shows in the second table (CMDB CI related). Any help? thanks