create table test1023(id int); --創建測試表 test1023 declare cnt int; begin select count(*) into cnt from test1023; if cnt=0 then insert into test1023 values('1'); commit; --觸發器中 需要將這句刪除; end if; end;
參:http://zhidao.baidu.com/link?url=WruRf6fvsDrqjIuESnzcwi0CVDT5b3lT8s1rncvbTCdvoOiKY9CcFa1BPoJw_IEyRi4kJWfhXJ9v4XoUAi4tl4fw7_M1dsVLakV2rcQKLna