I have often SQL statements of the kind
SELECT LENGTH(col_name) FROM `table` WHERE *condition*
to establish the size of the contents of a specific column in a given row of a mySQL table. However, it is not clear to me that there is a single SQL statement that would fetch the sum of the content lengths of ALL the columns in a given row. I should add that all the columns in question are VARCHARS.
Yes, I know I could do this by fetching the entire row as
SELECT * FROM `table` WHERE *condition*
collapsing the resulting row contents into a string and getting the length of that string but I was wondering if there isn’t a more efficient one liner to do the job. Any tips would be much appreciated.
Well, I prefer to use
CHAR_LENGTHoverLENGTHFrom the linked question