select t1.emp_name, (SELECT COUNT(*) FROM emp_mst a2 WHERE t2.emp_name + CAST( t2.emp_id AS char(10)) <= t1.emp_name + CAST( t1.emp_id AS char(10)) ) AS Sequence FROM emp_mst a1 ORDER BY t1.emp_name + CAST( t1.emp_id AS char(10))If 'emp_name' is unique you can remove CAST( t*.emp_id AS char(10)) ) from the query.
>Srl. No. Name >------------------------- >1 abc >2 xyz>how should i do this ?????