Search code examples
sql-server-2005

Swap first name and last names in a column using SQL


How do I change the first name and last name from a given name, for example: I have a name "Krishna Kiran" with Krishna as the first name and Kiran as the last name (surname) in a column.

Now I need the output as "Kiran, Krishna", that is, lastname, firstname. How can I do this?


Solution

  • Try This