Created
November 18, 2014 11:08
-
-
Save zafergurel/caf7054381785b59060a to your computer and use it in GitHub Desktop.
Adları, Ad Soyad olarak ayırmak (SQL)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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