I have a two tables one is master and another one is working table.
i would need to Join two tables Item master and Fb, and Fb column values should be column header how to write a sql query for this
Itemmaster table:
barcode | design | shade| size | sleeve | brd| dept |
+----------+-----------+-------+------+--------+-------------+-----------+
| | | | | | | |
| OD132829 | 87282 | 1 | 36 | F/S | CE | FORMAL SH |
| OD132830 | 87282 | 1 | 38 | F/S | CE | FORMAL SH |
| OD132832 | 87282 | 1 | 40 | F/S | CE | FORMAL SH |
| OD132833 | 87282 | 1 | 42 | F/S | CE | FORMAL SH |
| OD132834 | 87282 | 1 | 44 | F/S | CE | FORMAL SH |
| OD132837 | 87282 | 2 | 36 | H/S | CE | FORMAL SH |
| OD132838 | 87282 | 2 | 38 | H/S | CE | FORMAL SH |
| OD132840 | 87282 | 2 | 40 | H/S | CE | FORMAL SH |
| OD132841 | 87282 | 2 | 42 | H/S | CE | FORMAL SH |
| OD132842 | 87282 | 2 | 44 | H/S | CE | FORMAL SH |
| OD132843 | 87282 | 2 | 46 | H/S | CE | FORMAL SH |
Fabric Table
Lot No Job No Barcode design shade qty
LOT/001/17-18 JOB/001/17-18 OD132829 87282 1 3
LOT/001/17-18 JOB/001/17-18 OD132830 87282 1 12
LOT/001/17-18 JOB/001/17-18 OD132832 87282 1 13
LOT/001/17-18 JOB/001/17-18 OD132833 87282 1 5
LOT/001/17-18 JOB/001/17-18 OD132834 87282 1 11
LOT/001/17-18 JOB/002/17-18 OD132837 87282 2 30
LOT/001/17-18 JOB/002/17-18 OD132838 87282 2 34
LOT/001/17-18 JOB/002/17-18 OD132840 87282 2 30
LOT/001/17-18 JOB/002/17-18 OD132841 87282 2 13
LOT/001/17-18 JOB/002/17-18 OD132842 87282 2 2
LOT/001/17-18 JOB/002/17-18 OD132843 87282 2 11
I would need to be a output
Lot No Job No DEsign shade 36 38 40 42 44 46
LOT/001/17-18 JOB/001/17-18 87282 1 3 12 13 5 11
LOT/001/17-18 JOB/002/17-18 87282 2 30 34 30 13 2 11