- each product has a set of related article clock
each big goods barcode, process has long have short, he is going to do and do the order through the repair order serial number to decide, as in the example data, there are two big goods is finished, a total of three sets of 12 kw machine 2 sets,
Each have to undergo machine core assembly, A machine core assembly B, assembling machine core C, D machine core assembly, machine core assembly E A total of five processes, another one finished 12 kw single koala need laser, bending, welding, assembly, testing,
Clear packaging, finished product storage, a total of seven, a SQL statement, obtain the following results
Big goods barcode, sales order quantity, order time, delivery, product code, product name, product specifications, the client code, production volume, production detail note, production specifications, documentary, the designer, the order number, customer name, employee name, production task order number, documents making, dynamic process (section), the working procedure 1 code, process name of 1, 2 code process, process name, 2... Work procedure name, code, [because of the sample data of three products, the most is 7 process]
M210307010 BP18-0002 * 001 * 20210307 *, and omit,,, 'movement to assemble A', '000004 * 8 * BP18-0002', 'movement to assemble A', '000004 * 8 * BP18-0002', 'movement assembly B', '000004 * 9 * BP18-0002', 'movement assembly C', '000004 * 10 * BP18-0002', 'D' movement assembly, '000004 * 11 * BP18-0002', 'movement assembly E', '000004 * 12 * BP18-0002', NULL, NULL, NULL, NULL
M210307010 BP18-0002 * 002 * 20210307 *, and omit,,, 'movement to assemble A', '000004 * 8 * BP18-0002', 'movement to assemble A', '000004 * 8 * BP18-0002', 'movement assembly B', '000004 * 9 * BP18-0002', 'movement assembly C', '000004 * 10 * BP18-0002', 'D' movement assembly, '000004 * 11 * BP18-0002', 'movement assembly E', '000004 * 12 * BP18-0002', NULL, NULL, NULL, NULLCREATE TABLE # temp222 (work order serial number int, work order number VARCHAR (20), big goods barcode VARCHAR (80),
FCP01 M210307010-201-0472 * 001 * 20210307 *, and omit,,, 'laser', '000001 * 1', 'bending', '000001 * 2', 'welding', '000001 * 3', 'assembly', '000001 * 4', 'test', '000001 * 5', 'clean packaging', '000001 * 6', 'finished product warehousing,' 000001 * 7 ', NULL, NULL
The CREATE TABLE # temp222 (work order serial number int, work order number VARCHAR (20), big goods barcode VARCHAR (80),
Int process scheduling, sales order number DECIMAL (18, 4), the time of placing your order Date, delivery Date, product code VARCHAR (80),
Product name VARCHAR (80), the product specifications VARCHAR (80), the client code VARCHAR (80), the process name VARCHAR (80),
Process barcode VARCHAR (80), the production of a DECIMAL number (18, 4), production detail note VARCHAR (120), the production material code VARCHAR (80),
Production material name VARCHAR (80), the production instructions VARCHAR (80), the line number VARCHAR (20), documentary VARCHAR (20), line name VARCHAR (80),
Designer VARCHAR (80), the order number VARCHAR (80), the customer name VARCHAR (80), the staff name VARCHAR (80), the production task order VARCHAR (80),
Make time to Date
)
Insert into # temp222 values (1, '046711', 'BP18 - M210307010 * 20210307 * 0002 * 001', 1,0.00, NULL, NULL, 'BP18-0002', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement to assemble A ', '000004 * 8 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (2, '046712', 'BP18 - M210307010 * 20210307 * 0002 * 001', 2,0.00, NULL, NULL, 'BP18-0002', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly B ', '000004 * 9 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (3, '046713', 'BP18 - M210307010 * 20210307 * 0002 * 001, 3,0.00, NULL, NULL,' BP18-0002 ', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly C ', '000004 * 10 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (4, '046714', 'BP18 - M210307010 * 20210307 * 0002 * 001', 4,0.00, NULL, NULL, 'BP18-0002', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly D ', '000004 * 11 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (5, '046715', 'BP18 - M210307010 * 20210307 * 0002 * 001, 5,0.00, NULL, NULL,' BP18-0002 ', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly E ', '000004 * 12 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (6, '046716', 'BP18 - M210307010 * 20210307 * 0002 * 002', 1,0.00, NULL, NULL, 'BP18-0002', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement to assemble A ', '000004 * 8 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (7, '046717', 'BP18 - M210307010 * 20210307 * 0002 * 002', 2,0.00, NULL, NULL, 'BP18-0002', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly B ', '000004 * 9 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (8, '046718', 'BP18 - M210307010 * 20210307 * 0002 * 002, 3,0.00, NULL, NULL,' BP18-0002 ', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly C ', '000004 * 10 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (9, '046719', 'BP18 - M210307010 * 20210307 * 0002 * 002', 4,0.00, NULL, NULL, 'BP18-0002', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly D ', '000004 * 11 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (10, '046720', 'BP18 - M210307010 * 20210307 * 0002 * 002, 5,0.00, NULL, NULL,' BP18-0002 ', '12 kw movement', '411 * 173 * 155 mm, NULL,' movement assembly E ', '000004 * 12 * BP18-0002', 2, NULL, 'BP18-0002', '12 kw movement, NULL,' 000004 ', NULL, 'machine core assembly, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
Insert into # temp222 values (11, '046726', 'FCP01 M210307010-201-0472 * * 20210307 * 001', 1,0.00, NULL, NULL, 'FCP01-201-0472', '12 kw single ones',' 411 * 155 mm, NULL, 'laser', '000001 * 1', 1, NULL, 'FCP01-201-0472-1', '12 kw single koala - shell sheet metal materials recipients', NULL,' 000001 ', NULL, 'laser bending, NULL, NULL, NULL,' ERP maintenance ', 'M210307010', '2021-03-07 22:26:51. 000')
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull