我在正在使用的服务器上只有SELECT权限。我正在尝试编写一个查询,其中一列是格式化的日期时间: --mydb.EventDate is column EventDate(datetime, not null)
SELECTDISTINCT、时间顺序进行排序。然而,对于这种格式,它是按字母顺序排序的(我想)。由于SELECTDISTINCT
eventTime字段作为时间存储在模式中,为HH:MM:SS,但我只想要HH:MM。我尝试在select语句中使用TIME_FORMAT(eventTime,'%H:%i'),但它不起作用。$query="SELECT id,eventDate,eventTime, eventName FROM specialevents ORDER BY eventDate,eventTime ASC"