在视图中用orderby
来源:互联网 发布:pbx指标软件 编辑:程序博客网 时间:2024/06/11 10:23
<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>
大家知道
1:如下查询语句没问题
select*fromsysobjectsorderbyname
2:如果把该查询语句建成视图
createviewv_test
as
select*fromsysobjectsorderbyname
会提示出错:
Theorderbyclauseisinvalidinviews,inlinefunctions,derivedtables,andsubqueries,unlessTOPisalsospecified.
3:既然提示除非在语句中使用top才能用orderby,那就好说了
createviewv_test
as
selecttop100percent*fromsysobjectsorderbyname
一切正常
再用select*fromv_test查一下,确实已经正确排序。
<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>
大家知道
1:如下查询语句没问题
select*fromsysobjectsorderbyname
2:如果把该查询语句建成视图
createviewv_test
as
select*fromsysobjectsorderbyname
会提示出错:
Theorderbyclauseisinvalidinviews,inlinefunctions,derivedtables,andsubqueries,unlessTOPisalsospecified.
3:既然提示除非在语句中使用top才能用orderby,那就好说了
createviewv_test
as
selecttop100percent*fromsysobjectsorderbyname
一切正常
再用select*fromv_test查一下,确实已经正确排序。
<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>
- 在视图中用orderby
- 如何在视图中使用ORDERBY短语
- 在视图中用order by
- 在ASP.NET中用树视图管理系统目录
- 在SQL Server中用索引视图查看性能状况
- 在SQL Server中用索引视图查看性能状况
- HANA查看某个表在哪些视图中用到了
- Android 在布局中用代码随意添加视图
- LinQ - Orderby
- linq orderby
- ng-orderby
- 新wms中用到的视图
- MVC中用分部视图封装DataGrid
- 在CScrollView中用CRectTracker。
- 在activitygroup中用startActivityForResult
- 在eclipse中用ns3
- 在C#中用WinAPI
- 在axis2中用log4j
- SQLSERVER2000系统提供的跟踪函数(二)
- SQLSERVER2000系统提供的跟踪函数(一)
- 显示中的表结构(新增了索引及表的描述信息)
- WIN2000下使用错误一例
- neodatis.odb 第一篇 存储对象的偏移地址
- 在视图中用orderby
- FORMS6IOBJECT-BASEDFEATURES(1)
- 使用技术实现OWC对的展示(二)
- 使用技术实现OWC对的展示(一)
- 如何实现对单个字段进行加密
- 连接集锦
- 工资系统两种方法
- SQL邮件自动应答(根据收到的邮件中的查询语句回复语句执行结果)
- 中几个表之间的关联查询