Doing a unique count in a database view

matthew_hughes
Kilo Sage

In my instance, I'm trying to build a database view to view ‘Key Software Models’ in ServiceNow. The definition of a 'Key Software Model' is:

  • Version: Major (i.e. has no parent) but could be discovered on a minor version.

  • Discovered on server: Non-disposed & depended on by an IBP Tier A or Tier B application.

  • Activation Status: Not Retired

  • Category: Operating System or Subcategory: Relational Database

 

Whilst I've got the 2nd to 4th bullet points configured in my database view. I'm not too sure on how and if I can implement the first bullet point. 

The  count is:

If the record has no Parent (spm_u_parent = Empty) Count the unique Software Models as these are Majors

+

If the record has a Parent (spm_u_parent != Empty) Count the unique Software Model Parents

 

The below is a screenshot that shows two 'Key Software Models':

matthew_hughes_0-1778743567162.png

 

Unicom Systems solidDB 7.0 has no parent so is counted as one 'Key Software Model'. There are then Red Hat 9.2, Red Hat 9.3 and Red Hat 9.4. Which all have the same parent (Red Hat 9). So the two 'Key Software Models' in this example should be nicom Systems solidDB 7.0 and Red Hat 9.2 .

 

So I was just wondering if the data in the database view can be manipulated in someway to show all the 'Key Software Models'

 

0 REPLIES 0