I'll display my query in an HTML table but some values are too long (70 characters)... I'd like to know if it's posiible to truncate these fields in the query.
NB: I don't want to modify my DB design!!
Yes, you can truncate a text field in a query. For example, assume that the field whole_address is 80 characters long, to view just the left 50, you would use:
SUBSTRING(whole_address,1,50)
Where the first number (in this case 1) is the starting point from the left, in this case, the first character (but does not have to be) and the 50 is the number of characters you are going to view. To view the last 50, it would just be
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.