i am trying to create a database view to show records from table a but not exists in table b using left join

Srinivasa Rao
Tera Contributor

Hi,

I have two tables with similar column names and I need to return records from the left table which are not found in the right table

I know how to write this in SQL Server but not familiar with ServiceNow Left Join any help would be really appreciated..

SELECT a.*
FROM TableA a

LEFT JOIN TableB b

ON b.col1 =a.col2

WHERE b.col1 is NULL

What i need in ServiceNow is

SELECT a.*
FROM Change_Request a

LEFT JOIN sysapproval_approver b

ON b.sysapproval =a.SYS_ID

WHERE b.sys_id is NULL

Please advise...

Thanks in advance..

16 REPLIES 16

Just sent it along to you, let me know if you have any other questions.


Muhammad Salar
Giga Sage

Hi,
An alternative:
Solved: how can i report on users that haven't logged an i... - ServiceNow Community
You can create a report for this purpose, this functionality is available in reporting.