Absent Member.. Absent Member..
Absent Member..
189 views

Querying nodes and nodegroups

Jump to solution

Hello,

 

We just restructured the node groups. Now I need to verify that all the nodes are part of any one of the Newly created nodegroups. Best way I feel to check in SQL DB.

 

All the nodes belong to group which contain XYZ in the groupname.

Newly created group name contains "ABC" , "JKL" and "LMN" in it.

 

I am trying this query.

 

Select SYSTEMID from the GROUPS where groupname like '%XYZ%' and (Groupname like'%ABC%' or Groupname like'%JKL%' or Groupname like'%LMN%')

 

but this query returns nothing and if I run this query without the AND and OR condition for individual condition it works.

 

Could someone assist?

 

OMWst

Labels (1)
0 Likes
1 Solution

Accepted Solutions
Captain
Captain
Hi,
Select SYSTEMID from the GROUPS where groupname like '%XYZ%' and SYSTEMID not in (select SYSTEMID from the GROUPS where Groupname like'%ABC%' or Groupname like'%JKL%' or Groupname like'%LMN%')

Micro Focus Software Support

The views expressed in my contributions are my own and do not necessarily reflect the views and strategy of Micro Focus.

If you find this or any post resolves your issue, please be sure to mark it as an accepted solution.

View solution in original post

3 Replies
Captain
Captain
The groupname should not contains "XYZ" and ( "ABC" , "JKL" or "LMN"). if you want to get the nodes belongs to "XYZ" and the new groups. you can use:
Select SYSTEMID from the GROUPS where groupname like '%XYZ%' and SYSTEMID in (select SYSTEMID from the GROUPS where Groupname like'%ABC%' or Groupname like'%JKL%' or Groupname like'%LMN%')

Micro Focus Software Support

The views expressed in my contributions are my own and do not necessarily reflect the views and strategy of Micro Focus.

If you find this or any post resolves your issue, please be sure to mark it as an accepted solution.
Absent Member.. Absent Member..
Absent Member..

Thank You Jindong.

 

With the result i see a lot of missing nodes. So i need to run query in reverse.

get a list of nodes which are part of node group XYZ but does not belong to "ABC" , "JKL" or "LMN").

 

Could you get me query for the same?

 

OMWst

 

0 Likes
Captain
Captain
Hi,
Select SYSTEMID from the GROUPS where groupname like '%XYZ%' and SYSTEMID not in (select SYSTEMID from the GROUPS where Groupname like'%ABC%' or Groupname like'%JKL%' or Groupname like'%LMN%')

Micro Focus Software Support

The views expressed in my contributions are my own and do not necessarily reflect the views and strategy of Micro Focus.

If you find this or any post resolves your issue, please be sure to mark it as an accepted solution.

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.