去年使用Microstrategy Netezza语法的ApplySimple公式

问题描述 投票:0回答:1

我想帮助将以下applysimple语句转换为它的netezza等价物。

ApplySimple("(
   select top 1 tradyrcode
   from tradingyear
   where tradyrcode < (
      select max(tradyrcode)
      from yrdays yd, control c
      where c.systemdate = yd.datecode
   )
   order by 1 desc
)",0)

我想我需要将top 1更改为limit 1才能在netezza中工作。

任何帮助将非常感激!

netezza microstrategy
1个回答
0
投票

'top nn'位于语句的开头,'limit nn'必须在可能的'order by'之后的最后:

select tradyrcode
from trading-year
where tradyrcode < (
  select max(tradyrcode)
  from yrdays yd, control c
  where c.systemdate = yd.datecode
)
order by 1 desc
limit 1
© www.soinside.com 2019 - 2024. All rights reserved.