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