I don't understand why this didn't work out:
select id,name,concat(substring(description,0,30),'...') as desc_shortened, created_date,added_by from products
Even though there is data inside of the description
field. I didn't see any field example on mySQL documentation tho. They used pure strings instead of column names.
concat(susbtring(description,0,30))
only returns ...
and that's all.
Use substring(description,1,30)
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With