sql server - How to get first character of a string in SQL? -


I have an SQL column with a length of 6. Now you want to take only the first letter of that column. Is there a string function in SQL to do this?

left (colName, 1) will do the same too. This is equivalent to SUBSTRING (colName, 1, 1) .

I like it LEFT , because I find it a bit cleaner, but in reality, there is no difference.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -