I use TP5 framework, query the type of a warehouse collect such operation,
Db: : the table (' MTK)
- & gt; Field (" ordernum, model, figure, tp, count (model) as CNT ')
- & gt; The where (' status', 0)
- & gt; Group (" ordernum ")
- & gt; The order (' CNT)
- & gt; The select ();
Summary of how the three warehouse, same quantity, put together,
The code is too long, can't upload attachments,
The SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
The SET time_zone="+ 00:00";
/*! 40101 SET @ OLD_CHARACTER_SET_CLIENT=@ @ CHARACTER_SET_CLIENT */.
/*! 40101 SET @ OLD_CHARACTER_SET_RESULTS=@ @ CHARACTER_SET_RESULTS */.
/*! 40101 SET @ OLD_COLLATION_CONNECTION=@ @ COLLATION_CONNECTION */.
/*! 40101 SET NAMES utf8mb4 */.
-
-- the Database: ` LPLT `
-
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- table structure ` bcpk_copy1 `
-
The CREATE TABLE IF NOT EXISTS ` bcpk_copy1 ` (
` id ` int (10) unsigned NOT NULL COMMENT 'id',
` ordernum ` char (32) NOT NULL COMMENT 'hs code',
` model ` char (32) NOT NULL COMMENT 'models',
` figure ` char (16) NOT NULL COMMENT 'pattern',
` tp ` char (16) NOT NULL COMMENT 'specifications'
` code ` char (32) NOT NULL COMMENT 'barcode'
` pd ` date NOT NULL COMMENT 'mother's womb, production date,
` workshop ` varchar (255) NOT NULL COMMENT 'production workshop,
` pdline ` varchar (255) NOT NULL COMMENT 'production line',
` lydate ` date NOT NULL COMMENT 'date of recipients',
` lybc ` varchar (32) NOT NULL COMMENT 'divisions of recipients',
Unsigned ` status ` tinyint (2) NOT NULL COMMENT 'status'
) ENGINE=InnoDB AUTO_INCREMENT=1102847 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-
- archived data in a table ` bcpk_copy1 `
-
INSERT INTO ` bcpk_copy1 ` (` id `, ` ordernum `, ` model `, ` figure `, ` tp `, ` code `, ` pd `, ` workshop `, ` pdline `, ` lydate `, ` lybc `, ` status `) VALUES
R18 (23, '03944', '235/55', 'LP18', '100 v', '0395331530', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (25, '03944', '235/55', 'LP18', '100 v', '0395331352', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (26, '03944', '235/55', 'LP18', '100 v', '0395331464', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (28, '03944', '235/55', 'LP18', '100 v', '0395331388', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 1),
R18 (33, '03944', '235/55', 'LP18', '100 v', '0393720995', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (34, '03944', '235/55', 'LP18', '100 v', '0393721046', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (36, '03944', '235/55', 'LP18', '100 v', '0393721014', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 1),
R18 (38, '03944', '235/55', 'LP18', '100 v', '0393721121', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (41, '03944', '235/55', 'LP18', '100 v', '0395331337', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 1),
R18 (42, '03944', '235/55', 'LP18', '100 v', '0393721161', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 1),
R18 (43, '03944', '235/55', 'LP18', '100 v', '0393721204', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (62, '03944', '235/55', 'LP18', '100 v', '0393721220', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (64, '03944', '235/55', 'LP18', '100 v', '0395331427', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (67, '03944', '235/55', 'LP18', '100 v', '0395331377', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (70, '03944', '235/55', 'LP18', '100 v', '0395331473', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 1),
R18 (73, '03944', '235/55', 'LP18', '100 v', '0395331353', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (77, '03944', '235/55', 'LP18', '100 v', '0395331547', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
245/35 (81, '03947', 'the r20', 'LP17', '95 w', '0393720996', '2017-12-01', 'A workshop,' line 1 ', '2018-11-09', 'A', 0),
R17 (82, '03946', '235/65', 'LP19', '104 h', '0393721047', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0),
R18 (85, '03950', '245/45', 'LP17', '100 w', '0393721033', '2017-12-01', 'A workshop', 'line 1', '2018-11-09', 'A', 0).
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- table structure ` cpk_copy1 `
-
The CREATE TABLE IF NOT EXISTS ` cpk_copy1 ` (
` id ` int (10) unsigned NOT NULL COMMENT 'id',
` ordernum ` char (32) NOT NULL COMMENT 'product coding,
` model ` char (32) NOT NULL COMMENT 'models',
` figure ` char (16) NOT NULL COMMENT 'pattern',
` tp ` char (16) NOT NULL COMMENT 'specifications'
` code ` char (32) NOT NULL COMMENT 'barcode'
` pd ` date NOT NULL COMMENT 'MT production date,
` rknum ` int (11), NOT NULL COMMENT 'receipt number,
` workshop ` varchar (255) NOT NULL COMMENT 'production workshop,
` pdline ` varchar (255) NOT NULL COMMENT 'production line',
` BC ` varchar (32) NOT NULL COMMENT 'flight',
` date ` date NOT NULL COMMENT 'production date',
Unsigned ` status ` tinyint (2) NOT NULL COMMENT 'status'
) ENGINE=InnoDB AUTO_INCREMENT=1102847 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-
- archived data in a table ` cpk_copy1 `
-
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull