Ramon Quintana

Ramon Quintana

  • NA
  • 404
  • 65.4k

Clause ORDER BY doesn’t work in VIEWS

Aug 21 2019 4:02 PM
Hi,
 
I have a Query that has the instruction ORDER BY inside the SELECT, for example:
 
SELECT
dbo.Query_Base.Cuentas_Maestro_Numero_cuenta,
dbo.Query_Base.Cuentas_Maestro_Profit_Center,
dbo.Query_Base.Trading_Partner,
dbo.Query_Base.Partner_Profit_Ctr,
dbo.Query_Base.Cuentas_MaestroTransType,
dbo.Query_Base.profit_center_local_currency,
,sum(dbo.Query_Base.profit_center_local_currency)
OVER (PARTITION BY Query_Base.Cuentas_Maestro_Numero_cuenta,Query_Base.Fiscal_Year-Query_Base.Cuentas_Maestro_Numero_cuenta,Query_Base.Fiscal_Year,Query_Base.Period
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS Change_SAP,
ETC ETC ,
 
and a FINAL ORDER BY clause too..so i can not to convert this Query in a VIEW because this one it not allows this clause on it..and i need this View to create a .CSV file from it.
 
Any suggestion??
Thanks..

Answers (5)