MySQL: How to convert seconds to mm:ss format?
<p>I want to convert seconds to <code>minute : seconds</code> format in sql select statement.</p>

<p>At the moment I am using:</p>

<pre><code>SELECT SEC_TO_TIME(duration) from messages; 
</code></pre>

<p>It works perfectly but it gives me this format of time: <code>hh:mm:ss</code> 
but I need <code>mm:ss</code></p>

<p>Is it possible to convert seconds into <code>mm:ss</code> format using sql query?</p>