Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SELECT `contract_fine` AS TotalFine FROM `contract` NATURAL JOIN `rented_vehicle` WHERE `contractID` = 3;
这会返回多行数字,我将如何将它们加在一起,我似乎做不到。
SELECT SUM(`contract_fine`) AS TotalFine FROM `contract` NATURAL JOIN `rented_vehicle` WHERE `contractID` = 3;
就这么容易。