I need help on a view I am trying to create. In my sql code I am using the row_number() function (see code below). The sql works fine as a query but when I try to create a view I get error:
The OVER SQL construct or statement is not supported.
Please help me re write this sql so I can use it as a view.
SELECT cfk.customerID,
nda.acct_nbr,
nda.App_Description,
row_number() over (partition by LEFT(cfk.cfk_cif_nbr,12) order by nda.nd_acct_nbr) as Acct_Count
FROM cfk
INNER JOIN nda ON cfk.acct_nbr = nda.acct_nbr
AND cfk.appl_code = nda.appl_code
The OVER SQL construct or statement is not supported.
Please help me re write this sql so I can use it as a view.
SELECT cfk.customerID,
nda.acct_nbr,
nda.App_Description,
row_number() over (partition by LEFT(cfk.cfk_cif_nbr,12) order by nda.nd_acct_nbr) as Acct_Count
FROM cfk
INNER JOIN nda ON cfk.acct_nbr = nda.acct_nbr
AND cfk.appl_code = nda.appl_code