Skip to Content

how to select all b2bcustomers through the certain usergroup?

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'

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Oct 10, 2018 at 03:26 PM

    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'
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.