Looks like your Sql developer is using a fixed-pitch font, whereas your DBGrid isn't. Set your DBGrid to use a fixed-pitch font like Courier New.
In any case, for future reference, it is not very sound practice to use SQL on your SQL Server to do output formatting by using eg RPad(), especially when it is applied to every single row of a result set - it pointlessly consumes server resources and network bandwidth for something that should be left to the client to do.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.