I have all my data stamped with a field- dated which is in the format Y-m-d H:i- i would like to cast this field using mysql to represent the hour of the day so- 2011-11-21 15:28:05 would become 15- i have been reading the docs but it doesnt state whether or not you can specify a format
is this possible?
想法是,我可以计算一下,每小时有多少行章,然后用图表显示这一点。
这是我迄今所做的工作。
SELECT CAST(dated AS TIME) FROM `posts` WHERE CAST(dated AS DATE) = CAST( ".$start_date." as DATE) AND type = ORDER by dated ASC;