mysql decimal 测试使用
CREATE DATABASE IF NOT EXISTS Testing; USE Testing; CREATE TABLE WeightCalculation (WeightCalculationID INT NOT NULL, Weight DECIMAL(10,5) NOT NULL); INSERT INTO WeightCalculation (WeightCalculationID, Weight) VALUES (1,54.3445); INSERT INTO WeightCalculation (WeightCalculationID, Weight) VALUES (2,928.23017); SET @a = (SELECT SUM(WEIGHT) FROM WeightCalculation); INSERT INTO WeightCalculation (WeightCalculationID, Weight) VALUES (3,@a); SELECT * FROM WeightCalculation; DROP DATABASE Testing;CREATE DATABASE IF NOT