We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to add or condition in database view or clause

Obito
Tera Expert

Obito_0-1733405806377.png

 

Hi All, How can we add or condition in where clause so that we can add two tables.

7 REPLIES 7

Dr Atul G- LNG
Tera Patron

Hi @Obito 

 

We cant any condition in where clause. You can add condition when you create report using DB view.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Brad Bowman
Kilo Patron

You can use the || operator in a where clause to denote OR, but there are limitations.  Is this view working with one table as shown?

Yes @Brad Bowman  It is working.

As the metric definition is linked to the metric instance which is linked to the cs case table, I don't see how there would be definitions on any other table in this scenario.