Jump to content

help with a difficult query

Recommended Posts

Hi, I have a query that gets these fields:


service group




Basic TV



Hifh speed 1


I want to add to those fields another one that lists the number of services the number of services in each service group that the user still subscribe too.

I have a query that returns the number of services each subscriber has for each service category



service group

number of services











That last query returns millions of rows as my company has million of users and each user can have services in several service groups (internet, TV, Cellphone etc)


I am looking for a way to have the first query completed with information from the second query but only for the client in the result of the first query. I dont want it running the second query for every row of the first because then it would run a query that could return 4M lines presumably tens of thousands of times. Essentially what i want is a way to say: Hey i got this information from query one can you get me that more information from query two but only for this client, and rinse and repeat for each line of the first query.


Can anyone provide some helper as to how to do this? I'm a bit stuck .


Also I can't do that with several steps as I am working in a business intelligence tool that can only take query so a procedural approach wont work.

Thanks kindly,


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.