SQLBUG集之"随机排序中的newid()问题"
来源:互联网 发布:工资管理系统数据库 编辑:程序博客网 时间:2024/04/29 17:24
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
/**==**2.随机排序中的newid()问题**==**/--测试数据declare@ttable(namechar(1),valueint)insertinto@tselect'a',1unionallselect'a',2unionallselect'b',3unionallselect'b',4unionallselect'c',5unionallselect'c',6
--要求,随机排序,但name相同的要排在一齐selecta.*from@tajoin( selectaa=newid(),namefrom(selectdistinctnamefrom@t)a)bona.name=b.nameorderbyb.aa,newid()
/*--测试结果之一,并没有达到要求.如果将join改成leftrightfulljoin,就正确namevalue ---------------b 4b 3c 5a 1a 2c 6
(所影响的行数为6行)--*/
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
/**==**2.随机排序中的newid()问题**==**/--测试数据declare@ttable(namechar(1),valueint)insertinto@tselect'a',1unionallselect'a',2unionallselect'b',3unionallselect'b',4unionallselect'c',5unionallselect'c',6
--要求,随机排序,但name相同的要排在一齐selecta.*from@tajoin( selectaa=newid(),namefrom(selectdistinctnamefrom@t)a)bona.name=b.nameorderbyb.aa,newid()
/*--测试结果之一,并没有达到要求.如果将join改成leftrightfulljoin,就正确namevalue ---------------b 4b 3c 5a 1a 2c 6
(所影响的行数为6行)--*/
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- SQLBUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- SQL BUG集之"随机排序中的newid()问题"
- python编码问题之\"encode\"&\"decode\"
- 有关eclipse中"run"对话框中的参数设置问题
- 人际交往中的"三杯水"
- " " ' '
- 关于C++中的'extern "C"'
- 职场中的自然"潜规则"
- C++11 之 " = delete "
- hibernate 中的 lazy="proxy" 和 lazy="no-proxy" 的区别
- 更新字符串列表中,指定位置的字符串
- C# "未将对象引用设置到对象的实例"异常的原因 总结
- 得到指定字符串列表中,指定个数的字符串
- 创建作业的通用存储过程
- OK,let's go!
- SQLBUG集之"随机排序中的newid()问题"
- 不可小视视图对效率的影响力
- 对"一个非常难的查询问题(部门上下级的关系)"之解答的完善
- 大款驾车赴高校摆摊征婚 遭遇一群女生奚落围攻
- 中的反规范技术探讨
- 如何查询redologfile的使用率
- 一个有趣的SQL问题。
- 解决中记录重复问题
- 第一个