MySQL Forums
Forum List  »  Stored Procedures

Re: Center Align Integer Returned From Select Statement
Posted by: Peter Brawley
Date: July 31, 2019 11:44AM

That's usually done in the app language. In mysql it'll be awkward, eg ...

set @n=100;
set @pad = floor( (7-length(@n))/2 );
select concat( repeat(' ', @pad), @n, repeat(' ', @pad) ) as res;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Center Align Integer Returned From Select Statement
483
July 31, 2019 11:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.