Do you have a table that has *all* your employees ids (empl_id)?

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.


> -----Original Message-----
> From: Johan Lundqvist [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 31, 2006 1:13 PM
> To: mysql@lists.mysql.com
> Subject: How to merge my tables?
> 
> Hi,
> I hope this is the right forum for this question. If not, I'm happy to
> get some tip on where to post this.
> 
> My problem:
> I have like 20 tables of data and need to merge these, making a
> selection, (and dump it into a text file) to import into a reporting
> tool. The tables is like salesrep, value of sales, number of
customers,
> and som series of codes. If I do a JOIN, I only get the salesreps that
> exist in that specific table, but new people are added and some have
> left the company. How can this be done??
> 
> 
> A short example of the data:
> 
> Table_1998:
> empl_id | sales98 | customers98 | etc98 | ...
>     1001 |   12659 |         123 | ffff  | ...
>     1002 |  103674 |         597 | hued  | ...
>     1003 |   23589 |         314 | hjeoir| ...
> 
> Table_1999:
> empl_id | sales99 | customers99 | etc99 | ...
>     1001 |   35678 |         213 | dwrer | ...
>     1002 |  125795 |         603 | freui | ...
>     1003 |   45678 |         343 | hfiwu | ...
>     1004 |    8753 |          96 | poijo | ...
> 
> Table_2000:
> empl_id | sales00 | customers00 | etc00 | ...
>     1001 |   97361 |         526 | urhfn | ...
>     1003 |   98716 |         649 | jdwoh | ...
>     1004 |   15872 |         147 | oijnm | ...
> 
> Now I try to get the customersXX columns for every emloyee from these
> tables.
> What I would like to see in my result:
> empl_id | customers98 | customers99 | customers00 | ...
>     1001 |         123 |         213 |         526 | ...
>     1002 |         597 |         603 |        NULL | ...
>     1003 |         314 |         343 |         649 | ...
>     1004 |        NULL |          96 |         147 | ...
> 
> 
> I've tried everything and I'm out of clues.
> Can it be done?? If so, how???
> 
> Any help/tips are very welcome!!
> 
> /Johan, Uppsala - Sweden
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to