Coming from SQL Server or MS Access? You might be looking for LEN() to get the length of a string. In MySQL, it’s called LENGTH() instead.

You use it exactly the same way — just pass in the column name:

SELECT LENGTH(link) FROM my_table;

One thing to watch out for: LENGTH() in MySQL returns the length in bytes, not characters. For ASCII text this doesn’t matter, but for multi-byte character sets like UTF-8, a single character can be more than one byte. If you need the character count, use CHAR_LENGTH() instead.

For example, LENGTH('café') might return 5 (because the é is 2 bytes in UTF-8), while CHAR_LENGTH('café') returns 4. If you’re working with international text, CHAR_LENGTH() is usually what you want.