simpli Posted March 10, 2011 Share Posted March 10, 2011 Hi, I have a query that gets these fields: client service group service clien1 TV Basic TV clien1 INTERNET 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 Client service group number of services Client1 Internet 1 Client2 TV 2 Client2 Cellphone 1 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, JR Quote Link to comment https://forums.phpfreaks.com/topic/230173-help-with-a-difficult-query/ Share on other sites More sharing options...
Adam Posted March 14, 2011 Share Posted March 14, 2011 Which database platform is this for? Quote Link to comment https://forums.phpfreaks.com/topic/230173-help-with-a-difficult-query/#findComment-1187351 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.