Jump to content

Recommended Posts

- get a list of member ids

- get a sales volume of that members downline (10 levels deep)

- get everyone who has sold $100,000 in sales or more (including their downline's sales)

 

in the end, I want a temporary table that has 2 columns:

member_id and amount

 

member_id = root member id

amount = the sum of the amount of purchases that each member in his/her downline has bought (10 levels deep)

 

any thoughts?

Link to comment
https://forums.phpfreaks.com/topic/236973-mysql-loops/#findComment-1218106
Share on other sites

If I understand your objectives correctly simple SELECT's using the proper aggregate functions should answer those queries.

 

and for the temporary table you always can use VIEWS ... in other words:

- Create your VIEW with the SELECT aggregating the records in the way you want

- Use the VIEW to SELECT from it any further group of records.

 

Link to comment
https://forums.phpfreaks.com/topic/236973-mysql-loops/#findComment-1218110
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.

Guest
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.