cancel
Showing results for 
Search instead for 
Did you mean: 

how to select all b2bcustomers through the certain usergroup?

former_member647104
Discoverer
0 Kudos
2,537

For example: SELECT {bc:name} FROM {b2bcustomer AS bc LEFT JOIN usergroup AS ug ON { ??? Here is the question > How to get correct relation? I guess there should be another table with the same key, to relate it with b2bcustomer table and usergroup table ??? }} WHERE {bc:group} = 'b2bcustomer'

Accepted Solutions (1)

Accepted Solutions (1)

former_member620692
Active Contributor

The following query will give you all the users belonging to 'admingroup'. You can customize this as per your requirement:

 SELECT {u:uid}, {ug:uid} FROM
 {
    UserGroup as ug JOIN PrincipalGroupRelation as rel
    ON {ug:PK} = {rel:target}
    JOIN User AS u
    ON {rel:source} = {u:PK}
 }
 WHERE {ug:uid}='admingroup'
former_member647104
Discoverer
0 Kudos

Big thanks, that is what I'm looking for.

former_member620692
Active Contributor
0 Kudos

You are most welcome.

Answers (0)