<pre> table names ----- abu arun sugan suhe sagu viru dhone goru
<u> Sql query for above output </u>
previous_name current_name Lastname null abu arun abu arun sugan arun sugan suhe sugan suhe sagu suhe sagu viru sagu viru dhone viru dhone goru dhone goru null </pre>
If your source table has only the one column that you have indicated, there is no way you can get the output you are looking for. That is because the data in a table is an unordered collection. So SQL Server does not know that abu comes first, or that arun follows it or any other information about the ordering. Unless you have some other column that specifies how these names are to be ordered, you cannot get the output you are looking for.