当前位置: 代码迷 >> VFP >> 继续问十豆三老师:解决办法
  详细解决方案

继续问十豆三老师:解决办法

热度:1018   发布时间:2013-02-26 00:00:00.0
继续问十豆三老师:
Select Rand() as 随机数,* Into Cursor 临时表 From 表1 Where 字段名=1 Order By 1

上述命令,老师想得真是妙!

老师就是老师,我这个学生望尘莫及啊.

继续问:加一个条件:

只取20条记录:


Select Rand() as 随机数,* Into Cursor 临时表 From 表1 Where 字段名=1 and 只取表1的20条记录 Order By 1

------解决方案--------------------------------------------------------
Select top 20 Rand() as 随机数,* Into Cursor 临时表 From 表1 Where 字段名=1 Order By 1
or
select top 20 * from (
Select Rand() as 随机数,* Into Cursor 临时表 From 表1 Where 字段名=1 Order By 1) a
  相关解决方案