I am converting following code in SAS to Teradata
DATA T_SEQ;
SET Macro_SEQ;
SEQ+1;
by Sec_key;
IF FIRST.Sec_key then SEQ=1;
My teradata script is
select *, Row_Number() over (partition by Sec_key Order by SEC_key) as SEQ
from T_SEQ
Problem is teradata script is not giving me the same ouput like SAS Script and I am getting different sequence number in teradata output as compare to SAS Script.
Basically I need this type of SEQ
--------- -------------------- ---------------
Australia 1421810.92 1
Canada 2604540.71 1
Canada 1453719.46 2
Central 3189418.36 1
France 3121616.32 1