能否使用select或其他SQL语句取出表中具体某一行(具体是哪一行随即指定)的记录?SQL代码应该怎么编写。请指教!谢谢!
解决方案 »
- 怎样查询SqlServer2005的日志?
- 请问什么情况下使用set xact_abort on? 什么情况下使用rolback tran
- 安装SQL SERVER 2000 提示错误?
- 请教:如何从数据库中查找字段中含有汉字的行!
- 请帮忙写一个SQL语句,急用,谢谢大家了
- MSQL取整,判断列内容是否唯一
- 请问两个表有两个字段关联,为什么多出了好多重复的行?
- 用UDP时时采集数据,采集后能否存入SQL Sever里面?
- 给看一下写的触发器对不!!!!
- 非高手莫进 !!! SQL Server一千多万条数据分组统计 !!! 急急急 !!!
- 冰天雪地裸体拜求一SQL问题
- 删除一个数据库sql语句怎么写呀!
declare @i int
declare @sql varchar(200)
set @i='5'set @sql='select top 1 * from t where 序号 not in(select top '
set @sql=@sql+cast(@i-1 as varchar)+' 序号 from t)'
exec(@sql)
union all select 200,'b',20
union all select 300,'c',30
union all select 400,'d',40 declare @i int
declare @sql varchar(200)
set @i='4'set @sql='select top 1 * from ta where ID not in(select top '
set @sql=@sql+cast(@i-1 as varchar)+' ID from ta)'
exec(@sql)drop table ta
godeclare @count
select @count = count(*) from tadeclare @rank int
set @rank = ceiling(@count*rand()) with temp
as
(
select *,row_number() over(order by ID) as rank from ta
)
select ID,f1,Myvalue from temp
where rank = @rank
where ........