Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (20.3k points)

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

1 Answer

0 votes
by (40.7k points)

It's most preferable to use LEFT, as it's more readable and cleaner to use. Otherwise, there's no difference between them.  

LEFT(colName, 1) is equal to SUBSTRING(colName, 1, 1).

Browse Categories