I need to create multiple tables from a single table based on unique column values
Posted on 2013-10-01
I have a large table of say, 1,000,000 records. One of the columns in the table identifies a salesman's name. Let's say there are 50 unique salesmen. What I need to do is make a separate table for each salesman from the large table. Each salesman's table would include rows from the large table associated with that sales person. I don't always know the salesmen that will be in the table or how many. In other words, one time there may be 50 salesmen in the table, so I need to create 50 tables, other times there may be 45 or 55.
Another way of saying it is, I want to divide the large table into separate tables by sales person. (And each table only contains that sales persons rows/data.) Ideally the tables would be named (or include) the salesman's name in the column.
I hope that is clear. The question seems easier than the solution.
Thanks for any help.