Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Designing a split algorithm/sql

Author  Topic 

aberton
Starting Member

3 Posts

Posted - 2006-01-30 : 00:09:19
Hi all, I need some help designing a SQL statement. I am building a customer segmentation module where I can take a group of customers and split them n-ways by percentage. For example, my count comes back with 2500 and I would like to split that 3 ways (25%, 35% and 40%). I also must make sure that this is done dynamically (no temp tables)and I do not replicate customers across the 3 split groups. The results are populated onto the screen,one split group at time. I am having problems with the SQL/algorithm to make sure that all 3 splits always add up to the number above - 2500 in this case. Any ideas?

Thanks.
Alex.

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-01-30 : 01:09:26
see this
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-30 : 01:52:58
Post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -