declare @end int
select @end=cast(rand()*max(id)/2+ max(id)/2 as int) from table
print @end
max(id)两个整数中的最大那个