Reputation: 519
Simple question
What is the best way to change the output so that it only displays the last two decimals?
SELECT AVG(TIMESTAMPDIFF(hour, start_it,start_qa)
So that the output of '13.2500' displays as '13.25'.
Thanks for your help.
Upvotes: 0
Views: 1009
Reputation: 1269513
Normally, you would do this in the application layer. If you insist on doing it in the database, you can use format()
:
SELECT FORMAT(AVG(TIMESTAMPDIFF(hour, start_it,start_qa), 2)
Upvotes: 2