3
Create Table Billing3
(
billingId int primary key,
FoodCharge float DEFAULT 0,
DoctorCharge float DEFAULT 0,
TestCharge float DEFAULT 0,
OperationCharge float DEFAULT 0,
RoomCharge float DEFAULT 0,
Total float DEFAULT (FoodCharge + DoctorCharge + TestCharge + OperationCharge + RoomCharge)
)
不要存儲它。在你的選擇中計算它。 –
我想要表格自動加起來的值 –
是的,我知道。不要這樣做。 :)你需要一個觸發器來隨時更新字段。將邏輯放在select查詢中會更好。 –