This is my "product" table WHERE sku RLIKE 'IP-205-1067-16' or sku IN ('205-d-SC55G','205-d-RC099G','205-d-SC45G','205-d-RC099G')
:
+---------------------------+---------+-----------------------+-----------------------+-------------------------+----------------------------+
| sku | price_1 | full_color_imprint_id | embroidery_imprint_id | screen_print_imprint_id | laser_engraving_imprint_id |
+---------------------------+---------+-----------------------+-----------------------+-------------------------+----------------------------+
| IP-205-1067-16 | 1.55556 | NULL | NULL | 63276 | 32539 |
| IP-205-1067-16-39423495 | 1.55556 | NULL | NULL | 63276 | 32539 |
| IP-205-1067-16-1272347 | 1.55556 | NULL | NULL | 63276 | 32539 |
| IP-205-1067-16-56185 | 1.55556 | NULL | NULL | 63276 | 32539 |
| IP-205-1067-16-1706399150 | 1.55556 | NULL | NULL | 63276 | 32539 |
| 205-d-SC45G | 45 | NULL | NULL | NULL | NULL |
| 205-d-SC55G | 55 | NULL | NULL | NULL | NULL |
| 205-d-RC059G | 0.59 | NULL | NULL | NULL | NULL |
| 205-d-RC099G | 0.99 | NULL | NULL | NULL | NULL |
+---------------------------+---------+-----------------------+-----------------------+-------------------------+----------------------------+
This is my "imprint_locations" table WHERE imprint_method_id IN (63276,32539)
:
+--------+-------------------+------------+-------------+--------------+
| id | imprint_method_id | name | setup_sku | running_sku |
+--------+-------------------+------------+-------------+--------------+
| 809128 | 32539 | Body Right | 205-d-SC45G | 205-d-RC059G |
| 809129 | 32539 | Body Left | 205-d-SC45G | 205-d-RC059G |
| 808288 | 63276 | Body Right | 205-d-SC55G | 205-d-RC099G |
| 808289 | 63276 | Body Left | 205-d-SC55G | 205-d-RC099G
+--------+-------------------+------------+-------------+--------------+
This is the end result I'm trying to achieve:
+---------------------------+-----------------------------------------+-------------------------------------------+-------------------------------------------+---------------------------------------------+----------------------------------------------+------------------------------------------------+
| sku | embroidery_imprint_id_setup_sku_price_1 | embroidery_imprint_id_running_sku_price_1 | screen_print_imprint_id_setup_sku_price_1 | screen_print_imprint_id_running_sku_price_1 | laser_engraving_imprint_id_setup_sku_price_1 | laser_engraving_imprint_id_running_sku_price_1 |
+---------------------------+-----------------------------------------+-------------------------------------------+-------------------------------------------+---------------------------------------------+----------------------------------------------+------------------------------------------------+
| IP-205-1067-16 | NULL | NULL | 55 | 0.99 | 45 | 0.59 |
| IP-205-1067-16-39423495 | NULL | NULL | 55 | 0.99 | 45 | 0.59 |
| IP-205-1067-16-1272347 | NULL | NULL | 55 | 0.99 | 45 | 0.59 |
| IP-205-1067-16-56185 | NULL | NULL | 55 | 0.99 | 45 | 0.59 |
| IP-205-1067-16-1706399150 | NULL | NULL | 55 | 0.99 | 45 | 0.59 |
+---------------------------+-----------------------------------------+-------------------------------------------+-------------------------------------------+---------------------------------------------+----------------------------------------------+------------------------------------------------+
You can see that the product table has screen_print_imprint_id which matches the imprint_method_id in the imprint_locations table.