A product contains a
Item number warehouse size color number and other data
MySQL is also stored in such a field, but there is the same article number, not the same warehouse, different size situation
Now I need to select out the data format requirement is
Item No. 001 Size Color Quantity
———— Catalog No. 001 Warehouse 002 Size 1 Quantity size 2 quantity size 3 quantity
Item 2--Catalog No. 002 Size Color Quantity
———— Catalog No. 002 Warehouse 002 Size 1 Quantity size 2 quantity size 3 quantity
———— Catalog No. 002 Warehouse 003 Size 1 Quantity size 2 quantity size 3 quantity
Item 3--Catalog No. 003 Size Color
———— Catalog No. 003 Warehouse 003 Size 1 Quantity size 2 quantity size 3 quantity
....
That is, the same article number of the goods merged and then divided into different warehouses and different sizes
How would I write the SELECT statement?
I think it is to write multi-layered, the best way to be efficient?
Reply content:
A product contains a
Item number warehouse size color number and other data
MySQL is also stored in such a field, but there is the same article number, not the same warehouse, different size situation
Now I need to select out the data format requirement is
Item No. 001 Size Color Quantity
———— Catalog No. 001 Warehouse 002 Size 1 Quantity size 2 quantity size 3 quantity
Item 2--Catalog No. 002 Size Color Quantity
———— Catalog No. 002 Warehouse 002 Size 1 Quantity size 2 quantity size 3 quantity
———— Catalog No. 002 Warehouse 003 Size 1 Quantity size 2 quantity size 3 quantity
Item 3--Catalog No. 003 Size Color
———— Catalog No. 003 Warehouse 003 Size 1 Quantity size 2 quantity size 3 quantity
....
That is, the same article number of the goods merged and then divided into different warehouses and different sizes
How would I write the SELECT statement?
I think it is to write multi-layered, the best way to be efficient?
What you need to consider is the SKU