how do I limit the characters in selected row and con-cat with '...' I have a query which return a column named comment. I want to limit the number of characters returned by select statement to 50 and if the comment row contain more than 50 characters, I want to append ... at the end of it. How can i achieve this using on SQL query ?

Here is the query for my question. 

select comment from mip
where active = 1
You can use MySQL's IF function

select
    IF(LENGTH(comment) &gt; 50,CONCAT(LEFT(comment,50),'...'),comment) comment
from mip where active = 1;


or

select
    IF(LENGTH(comment) &gt; 50,CONCAT(SUBSTR(comment,1,50),'...'),comment) comment
from mip where active = 1;