如何在MySQL中的字段另一列設置默認值我已經做到了與虛擬領域的Oracle,但我不知道該怎麼做在MySQL,這是我的表:mysql的設置字段默認值其他列
create table TSM_TRANSACTION_TBL
(
TRANS_ID INT primary key auto_increment,
LOCATION_ID INT,
TRANS_DATE DATE,
RESOURCE_ID INT,
TS_ID INT,
MAX_VALUE INT,
BOOKED_UNITS INT default 0,
REMAINING INT default MAX_VALUE - BOOKED_UNITS,
BOOKED INT not null,
USER_ID INT,
TRANS_TIME TIMESTAMP
)
可能重複:http://stackoverflow.com/questions/6377977/mysql-default-value-as-other-fields-value – 2013-03-13 11:52:57