37 lines
1.6 KiB
SQL
37 lines
1.6 KiB
SQL
--“üŒÉƒe<C692>[ƒuƒ‹
|
||
CREATE TABLE ins_stock_m (
|
||
goods_id VARCHAR(10),
|
||
store_id VARCHAR(5),
|
||
ins_stock_exp_date DATE,
|
||
ins_stock_cmp_date DATE,
|
||
ins_stock_exp_num INT,
|
||
ins_stock_num INT,
|
||
PRIMARY KEY (goods_id, store_id, ins_stock_exp_date)
|
||
);
|
||
|
||
--ƒŒƒR<C692>[ƒh
|
||
INSERT INTO ins_stock_m VALUES
|
||
('ITM0000004','W0001','2010-03-03','2010-03-03',10,10),
|
||
('ITM0000001','W0001','2012-08-24','2012-08-24',2,2),
|
||
('ITM0000004','W0001','2012-10-05','2012-10-05',3,3),
|
||
('ITM0000001','W0001','2012-12-25','2012-12-25',3,3),
|
||
('ITM0000001','W0001','2013-06-01','2013-06-01',2,2),
|
||
('ITM0000004','W0001','2013-09-10','2013-09-10',6,6),
|
||
('ITM0000003','W0001','2013-09-17','2013-09-17',5,5),
|
||
('ITM0000001','W0001','2013-11-20','2013-11-20',5,5),
|
||
('ITM0000002','W0001','2014-03-04','2014-03-04',100,100),
|
||
('ITM0000004','W0001','2014-04-03','2014-04-03',2,2),
|
||
('ITM0000005','W0001','2014-04-28','2014-04-28',150,150),
|
||
('ITM0000005','W0001','2014-05-20','2014-05-20',100,100),
|
||
('ITM0000001','W0001','2014-08-08','2014-08-08',7,7),
|
||
('ITM0000002','W0001','2014-09-05','2014-09-05',50,50),
|
||
('ITM0000002','W0001','2014-09-10','2014-09-10',60,60),
|
||
('ITM0000001','W0001','2014-12-03',NULL,5,NULL),
|
||
('ITM0000002','W0001','2014-12-10',NULL,200,NULL),
|
||
('ITM0000003','W0001','2014-12-12',NULL,3,NULL),
|
||
('ITM0000004','W0001','2014-12-15',NULL,10,NULL),
|
||
('ITM0000005','W0001','2014-12-25',NULL,80,NULL)
|
||
SELECT * FROM ins_stock_m
|
||
ORDER BY ins_stock_exp_date;
|
||
|