截取数据库表中字符,大于50长度的其余部分截掉,并加“......”,不大于的原样输出:

select bookid,
       (case when length(bookContent)>50
		       then concat(left(bookContent,44),'......')
		       else bookContent
		       end)
        bookContent
from tbooks 


Logo

更多推荐