title: How to use to_char function functionality in MySQL
body: <p>I have a table <code>tine_by_day</code> and I know how to use <code>TO_CHAR</code> function in <code>oracle</code>, but how to get same output if I use in <code>MySQL</code>?</p>
  
  <p>Is there any conversion function in <code>MySQL</code> for <code>TO_CHAR()</code>?</p>
  
  <p>I have already tried <code>date_format</code> instead <code>to_char</code> but I'm not getting sufficient results.</p>
  
  <pre><code>SELECT
      to_char(t.the_date,'mm-DD-YYYY') Date,
      SUM(sf7.unit_sales) UnitSales,
      SUM(sf7.store_sales) StoreSales,
      SUM(sf7.store_cost) StoreCost
  FROM time_by_day t INNER JOIN sales_fact_1997 sf7 ON t.time_id=sf7.time_id
  WHERE
      to_char(t.the_date,'YYYY-MM-DD')&gt;='2012-01-01'
      AND
      to_char(t.the_date,'YYYY-MM-DD')&lt;='2012-01-07'
  GROUP BY t.the_date
  ORDER BY t.the_date
  </code></pre>