当子查询内存在ORDER BY 字句时查询会报错

问题:当子查询内存在ORDER BY 字句时查询会报错

SQL:

SELECT * FROM (

  SELECT * FROM USER ORDER BY USER_CORD

) S.

 

解决办法:在子查询SQL语句SELECT 后加 TOP 100 PERCENT (查询出前百分比为100的数据,也就是查询出全部数据)

SQL:

SELECT * FROM (

  SELECT  TOP 100 PERCENT  * FROM USER ORDER BY USER_CORD

) 

  

posted @ 2018-08-06 22:52  ZaraNet  阅读(231)  评论(0编辑  收藏  举报