• home
  • forum
  • my
  • kt
  • download
  • MySQL: GROUP BY on DATETIME field

    Author: 2008-09-12 10:01:09 From:

    Often webmasters want to sort out data on the basis of Dates when timestamp is stored as datetime in MySQL. To obtain the desired result, simply query:

    view plaincopy to clipboardprint?
    1. SELECT DATE_FORMAT(MyDate, '%d %M %Y'AS DateCOUNT(*) AS numRows FROM Table1 GROUP BY Date

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Miscellaneous (12)

    New

    Hot