您的位置:程序门 -> ms-sql server -> 应用实例



【求助】求一条sql语句


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


【求助】求一条sql语句[已结贴,结贴人:liuyangatlove]
发表于:2007-10-10 14:55:24 楼主
username       password  
aaa                   11111  
bbb                   11111  
ccc                   11111  
ddd                   11111  
将passwoord列的初始值全部随机为某2个数之间的值,这张表的数据是大量的,  
请问怎么解决?  
谢谢
发表于:2007-10-10 14:57:401楼 得分:0
将passwoord列的初始值全部随机为某2个数之间的值?

比如:..............?
发表于:2007-10-10 15:39:092楼 得分:20
比如插入20000-50000的值:
create   table   test(username   varchar(10),password   int)
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null
insert   test     select   'asdfj',null

update   test   set   password=cast((50000-20000)*rand(checksum(newid()))   as   int)+20000
发表于:2007-10-10 16:04:583楼 得分:0
ok   解决了   谢谢chuifengde(树上的鸟儿)呵呵~~非常之感谢,,,,


快速检索

最新资讯
热门点击