Return the first n letters of a column

I know that MySQL can select queries with a specific length.

Can MySQL output only the first 10 letters of a word?

Form example

mysql_query(SELECT LEFT(col,10),some2,some3 FROM someTable);

In colI have for example

'TextForExampleLongerThanTen'
'Text' 
'SHORTER'
'LONGERAGAINTHANTEN'

I want all of them to be displayed, but only the first 10 characters

+3
source share
1 answer

Use "LEFT ()", for example

SELECT LEFT(col, 10) FROM table;
+11
source

Source: https://habr.com/ru/post/1792575/


All Articles