请检查查询。
SELECT DATE_FORMAT( CAST( CONCAT( table.date, " ", table.time ) ) , '%p' )
FROM table AS table
Error:
[hash]1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), '%p') FROM exp_visitorsday as vd LIMIT 0, 30' at line 2
我在以下情况下尝试过此查询。
SELECT DATE_FORMAT( CAST( CONCAT( table.date, " ", table.time ) as datetimecol ) as datetimecol, '%p' )
FROM table AS table
SELECT DATE_FORMAT( CAST( CONCAT( table.date, " ", table.time ) as datetimecol ), '%p' )
FROM table AS table
样本数据:
table.date => 01-08-2013
table.time => 10:00 AM
如何查询?这个查询有什么问题?