select count(*) as num1 from tableif num1 = 0insert into ...elseselect * from table....
SQL的过程如下:Select top 1 * from tableif @@rowcount>0 --上一次影响条数 insert into Table --插入语句else Select * from Table --查询