詳細信息。 我有筆記表具有以下列。我需要計算一個日期時間列之間的日期/時間差
ID - INT(3)
Date - DateTime
Note - VARCHAR(100)
Tile - Varchar(100)
UserName - Varchar(100)
現在這張表將會在指定的日期/時間有NOTES以及UserName輸入的標題。
我需要計算在同一列
例如上表中具有的表中的信息這peice的兩行之間的DateTimeDifference。
64, '2010-03-26 18:16:13', 'Action History', 'sending to Level 2.', 'Salman Khwaja'
65, '2010-03-26 18:19:48', 'Assigned By', 'This is note one for the assignment of RF.', 'Salman Khwaja'
66, '2010-03-27 19:19:48', 'Assigned By', 'This is note one for the assignment of CRF.', 'Salman Khwaja'
現在我需要在使用MYSQL的查詢報告中有以下結果集。
TASK - TIME Taken
ACTION History - 2010-03-26 18:16:13
Assigned By - 00:03:35
Assigned By - 25:00:00
更聰明的辦法是
TASK - TIME Taken
ACTION History - 2010-03-26 18:16:13
Assigned By - 3 minutes 35 seconds
Assigned By - 1 day, 1 hour.
我將不勝感激如果可以給我平淡QUERY用PHP代碼一起嵌入到這一點。
http://php.net/manual/en/datetime.diff.php – Svisstack 2010-04-16 12:15:02
謝謝,但我會很感激MYSQL查詢以及。 – Stringz 2010-04-16 12:39:39