title: CTE row_number partition row rank using temp table
body: <pre><code>insert into #TempUserTable  
  </code></pre>
  
  <p>query  </p>
  
  <pre><code>;with cte as  
  (  
  select *,row_number() over(partition by (userid) order by login_time) as   'rowrank'  
  from #TempUserTable  
  )  
  </code></pre>
  
  <p>getting error incorrect syntax near ')'</p>