Skip to content

Instantly share code, notes, and snippets.

@zafergurel
Created November 18, 2014 11:08
Show Gist options
  • Save zafergurel/caf7054381785b59060a to your computer and use it in GitHub Desktop.
Save zafergurel/caf7054381785b59060a to your computer and use it in GitHub Desktop.
Adları, Ad Soyad olarak ayırmak (SQL)
-- Adları, Ad Soyad olarak ayırma
select left(FirstName, len(FirstName)-charindex(' ',reverse(FirstName))) as FirstName, right(FirstName, charindex(' ',reverse(FirstName))-1) as LastName from Users
-- Ad alanındaki ad/soyad verisiyle, ad ve soyad alanlarını güncelleme
update Users set FirstName = left(FirstName, len(FirstName)-charindex(' ',reverse(FirstName))), LastName = right(FirstName, charindex(' ',reverse(FirstName))-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment