title: SAS SEQ+1 in Teradata
body: <p>I am converting following code in SAS to Teradata</p>
  <pre><code>DATA T_SEQ;
  SET Macro_SEQ;
  SEQ+1;
  by Sec_key;
  IF FIRST.Sec_key then SEQ=1;
  </code></pre>
  <p>My teradata script is</p>
  <pre><code>select *, Row_Number() over (partition by Sec_key Order by SEC_key) as SEQ
  from T_SEQ
  </code></pre>
  <p>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.</p>
  <pre><code>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
  </code></pre>