相关子查询不能有TOP或ORDER BY

时间:2017-11-21 10:08:07

标签: sap hana

与SAP HANA合作 错误相关的子查询不能有TOP或ORDER BY

在从SQL到SAP HANA的迁移查询中使用Top 1和内部联接 尝试使用LIMIT但出错了。

   with cte As ( select SLART,upper(STEXT) as STEXT , ROW_NUMBER() over(partition by upper(STEXT) 
order by upper(STEXT) ASC ) as number 
FROM table1 
WHERE SLART LIKE 'X%' AND SPRSL='E' AND MANDT=client AND SLART != 'X0') 
select SLART,upper(substring(STEXT,1,1))+ lower(substring(STEXT,2,len(STEXT)) ) as 'STEXT' 
from cte where number = 1 
ORDER BY STEXT ASC 

需要从SQL迁移到SAP HANA我需要在HANA中等同于CTE

0 个答案:

没有答案