Home > Database > Mysql Tutorial > body text

除非另外还指定了TOP或FORXML,否则,ORDERBY子句在视图、内联函

WBOY
Release: 2016-06-07 16:02:49
Original
1698 people have browsed it

报错: 除非另外还指定了 TOP 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询和公用表表达式中无效。 只要我们在嵌套子查询视图里面加入: top 100 percent 即可 例如: select * from (select top 100 percent * from tb order by col des

报错:

除非另外还指定了 TOP 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询和公用表表达式中无效。

只要我们在嵌套子查询视图里面加入:top 100 percent即可

例如:

select * from (
select top 100 percent * from tb   order by col desc
) as a order by col desc
Copy after login
Related labels:
top
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!