Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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).

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.4k questions

32.5k answers

500 comments

108k users

Browse Categories

...