Database View Conditions

Kamva
Giga Guru

Hello Experts,

 

I am battling with the database view where clause. The aim is to create a database view that combines the user table and the delegates table to determine who is the delegate of who and who does not have any delegates. I have tried something but I am not getting the results I expected. When I am trying it, I got an error Where clause in view u_delegate has an improperly formatted name (user), please check my configs below and assist.

Kamva_0-1689299327566.png

 

Regards,

Kamva

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Kamva 

try this -> don't give where clause for sys_user table and give order as 200 for sys_user_delegate

sys_user                                                  usr         

sys_user_delegate                                 del                                del.user=usr.sys_id

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Kamva 

try this -> don't give where clause for sys_user table and give order as 200 for sys_user_delegate

sys_user                                                  usr         

sys_user_delegate                                 del                                del.user=usr.sys_id

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

@Ankur Bawiskar How do I keep all the contents (all the users) of my users' table and align all those delegates with those who have them?

Kamva_0-1689319696176.png

 

@Kamva 

Sorry didn't get your question

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