Mysql 如何跟踪更新的行数

Mysql 如何跟踪更新的行数,mysql,sql-server,Mysql,Sql Server,我使用的是sql2000,但我也使用mysql和sql2008,我对如何计算我刚刚更新的更新数量感兴趣?我确实看到哪里有更新的表,但不确定这是否在正常查询中。thx declare @updateCount as int set @updateCount = 0 begin transaction set @updateCount = update GENIUSES set IQ=161 where IQ=86 and username like 'RetroCoder' print @upda

我使用的是sql2000,但我也使用mysql和sql2008,我对如何计算我刚刚更新的更新数量感兴趣?我确实看到哪里有更新的表,但不确定这是否在正常查询中。thx

declare @updateCount as int
set @updateCount = 0
begin transaction
set @updateCount = update GENIUSES set IQ=161 where IQ=86 and username like 'RetroCoder'
print @updateCount
if @updateCount = 1 
  commit
else
  rollback
在SQL Server中:

DECLARE @updateCount INT;
UPDATE dbo.GENIUSES set IQ=161 where IQ=86 and username like 'RetroCoder';
SELECT @updateCount = @@ROWCOUNT;

你有mysql的例子吗?对不起,不是mysql的,但是请。
Declare @count  int
update GENIUSES set IQ=161 where IQ=86 and username like 'RetroCoder'
Set @count =  @@Rowcount
select @count