
synopsis:

    Activation-keys and the server-groups they are associated with

description:

    Lists all activation-keys and the server-groups they associate their system with

columns:

        org_id               The organization that owns the key
        token                The actual token for this key
        server_group_name    Server-groups the key places the server into

multival_columns:

        token
        server_group_name : server_group_name

sql:

    select * from (
      select rt.org_id, 
             ak.token,
             sg.name server_group_name
      from rhnactivationkey ak
           inner join rhnregtoken rt ON rt.id = ak.reg_token_id
           left outer join rhnregtokengroups rtg on rtg.token_id = rt.id
           left outer join rhnservergroup sg on sg.id = rtg.server_group_id
    ) X
    -- where placeholder
    order by org_id, token, server_group_name

