我想帮助将以下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中工作。
任何帮助将非常感激!
'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