I am using the following to only select the first 40 characters from a column
SELECT SUBSTRING(w.item_title,1,40) as title from tableName blah blah
What I really want to do though is:
If w.item_title is over 40 characters, return only the first 40 and append with … else just return w.item_title as it is
Is this possible at SELECT stage and should it be done there? Or should it be processed after the fact?
I am using JS to display the results.
See the manual on the INSERT() String function for examples.
EDIT
Last parameter of
SUBSTRshould be43as pointed out by Joachim.