CREATE TABLE IF NOT EXISTS `Lease_Agreement`
(
`ContractID` INT NOT NULL AUTO_INCREMENT,
`StartDate` DATE NOT NULL,
`Duration` INT NOT NULL,
`Rent` FLOAT NOT NULL,
`Live?` TINYINT(1) NOT NULL,
PRIMARY KEY(`ContractID`)
);
这是我在玩的东西,但可能有很多问题。
SELECT SUM(MONTH(StartDate) + Duration) AS "Total Time of Occupation"
任何帮助都将不胜感激