Ad ve soyad verilerinin tek bir tablo alanında olması ve bunları ayırma ihtiyacı olursa aşağıdaki SQL kullanılabilir:
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) |