Here basically iam stuck with issue of converting row data to column
.
tbl_emp_codes
tek_id emp_id emp_name emp_code
AK-0000002 39569 Rek Broc 99504
AK-0000002 39566 Rek Broc 99501
AK-0000002 39568 Rek Broc 99503
AK-0000002 39570 Rek Broc 99505
AK-0000002 39571 Rek Broc 99506
AK-0000002 39572 Rek Broc 99507
AK-0000002 39573 Rek Broc 99508
AK-0000002 39580 Rek Broc 99515
AK-0000002 39581 Rek Broc 99516
AK-0000002 39582 Rek Broc 99517
AK-0000002 39567 Rek Broc 99502
AK-0000003 39566 Tina Stee 99501
AK-0000003 39580 Tina Stee 99515
AK-0000003 39573 Tina Stee 99508
AK-0000003 39572 Tina Stee 99507
AK-0000003 39569 Tina Stee 99504
AK-0000003 39568 Tina Stee 99503
AK-0000003 39567 Tina Stee 99502
AK-0000003 39582 Tina Stee 99517
AK-0000003 39610 Tina Stee 99567
AK-0000003 39583 Tina Stee 99518
AK-0000003 39581 Tina Stee 99516
AK-0000003 39619 Tina Stee 99577
AK-0000004 39601 Trans Priory 99556
AK-0000004 39635 Trans Priory 99603
Above is the table I have got and Iam selecting for each tek_id and then inserting to emp_id1 the first emp_id,the first emp_code to emp_code1 and
second emp_id to emp_id2,the second emp_code to emp_code2..like that
They have already 15 emp_code and emp_id and they are pretty sure that it won't exceed that or is there any way to create colum according to the selection here
basically whenever there is 6th emp_code then only create 6 emp_code columns
Table-tbl_tek_emp
tek_id emp_id1 emp_code1 emp_id2 emp_code2 emp_id3 emp_code3......emp_code15
AK-0000002 39569 99504 39566 9501 39568 99503
.
tbl_emp_codes
tek_id emp_id emp_name emp_code
AK-0000002 39569 Rek Broc 99504
AK-0000002 39566 Rek Broc 99501
AK-0000002 39568 Rek Broc 99503
AK-0000002 39570 Rek Broc 99505
AK-0000002 39571 Rek Broc 99506
AK-0000002 39572 Rek Broc 99507
AK-0000002 39573 Rek Broc 99508
AK-0000002 39580 Rek Broc 99515
AK-0000002 39581 Rek Broc 99516
AK-0000002 39582 Rek Broc 99517
AK-0000002 39567 Rek Broc 99502
AK-0000003 39566 Tina Stee 99501
AK-0000003 39580 Tina Stee 99515
AK-0000003 39573 Tina Stee 99508
AK-0000003 39572 Tina Stee 99507
AK-0000003 39569 Tina Stee 99504
AK-0000003 39568 Tina Stee 99503
AK-0000003 39567 Tina Stee 99502
AK-0000003 39582 Tina Stee 99517
AK-0000003 39610 Tina Stee 99567
AK-0000003 39583 Tina Stee 99518
AK-0000003 39581 Tina Stee 99516
AK-0000003 39619 Tina Stee 99577
AK-0000004 39601 Trans Priory 99556
AK-0000004 39635 Trans Priory 99603
Above is the table I have got and Iam selecting for each tek_id and then inserting to emp_id1 the first emp_id,the first emp_code to emp_code1 and
second emp_id to emp_id2,the second emp_code to emp_code2..like that
They have already 15 emp_code and emp_id and they are pretty sure that it won't exceed that or is there any way to create colum according to the selection here
basically whenever there is 6th emp_code then only create 6 emp_code columns
Table-tbl_tek_emp
tek_id emp_id1 emp_code1 emp_id2 emp_code2 emp_id3 emp_code3......emp_code15
AK-0000002 39569 99504 39566 9501 39568 99503