title: Order By Issue with MySQL vs SQL Server
body: <p>I have one SQL query in <strong>SQL Server</strong> like this</p>
  
  <pre><code>SELECT 
      CASE WHEN ROW_NUMBER() OVER(PARTITION BY _no ORDER BY _no asc) = 1 THEN 
                          _no ELSE '' END 
      as row_no,
      _no,
      _name,
      r._names
  FROM
  (
      SELECT '1' as _no, 'vikas' as _name UNION ALL
      SELECT '1', 'kratika' UNION ALL
      SELECT '2', 'vikas' UNION ALL
      SELECT '1', 'kratika kastwar' 
  ) t
  INNER JOIN 
  (
      SELECT '1' as _nos, 'One' as _names UNION ALL
      SELECT '2', 'two' 
  ) r
  ON r._nos = t._no
  ORDER BY _no
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>row_no _no  _name           _names
  ------ ---- --------------- ------
  1      1    kratika         One
         1    kratika kastwar One
         1    vikas           One
  2      2    vikas           two
  </code></pre>
  
  <p>And the same I am doing in <strong>MySQL</strong> like this</p>
  
  <pre><code>SELECT 
      CASE WHEN _no = @i THEN '' ELSE @i := _no END
      as row_no,
      _no,
      _name,
      r._names
  FROM
  (
      SELECT '1' as _no, 'vikas' as _name UNION ALL
      SELECT '1', 'kratika' UNION ALL
      SELECT '2', 'vikas' UNION ALL
      SELECT '1', 'kratika kastwar' 
  ) t
  INNER JOIN 
  (
      SELECT '1' as _nos, 'One' as _names UNION ALL
      SELECT '2', 'two' 
  ) r
  ON r._nos = t._no
  ,
  (SELECT @i := '') temp
  ORDER BY _no
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code>1   1   vikas           One
      1   kratika         One
  1   1   kratika kastwar One
  2   2   vikas           two
  </code></pre>
  
  <p>But I am expecting output in <strong>MySQL</strong>  like this</p>
  
  <pre><code>1      1    kratika         One
         1    kratika kastwar One
         1    vikas           One
  2      2    vikas           two
  </code></pre>
  
  <p>I don't want to use query like this in <strong>MySQL</strong> as desc here <a href="https://stackoverflow.com/questions/14589481/mysql-order-by-w-count">MYSQL Order By W/Count</a></p>
  
  <pre><code>SELECT 
      CASE WHEN _no = @i THEN '' ELSE @i := _no END
      as row_no,
      _no,
      _name,
      _names
  FROM
  (SELECT 
      *
  FROM
  (
      SELECT '1' as _no, 'vikas' as _name UNION ALL
      SELECT '1', 'kratika' UNION ALL
      SELECT '2', 'vikas' UNION ALL
      SELECT '1', 'kratika kastwar' 
  ) t
  INNER JOIN 
  (
      SELECT '1' as _nos, 'One' as _names UNION ALL
      SELECT '2', 'two' 
  ) r
  ON r._nos = t._no
  ,
  (SELECT @i := '') temp
  ORDER BY _no) t
  </code></pre>
  
  <p>How I can achieve the same in MySQL, query performance is major parameter</p>