クエリの実行中
SELECT TIMESTAMPDIFF(SECOND, NOW(), 'select lastLoginTime from requests where id = 2 ')
NULL を返します。理由はわかりますか??
クエリの実行中
SELECT TIMESTAMPDIFF(SECOND, NOW(), 'select lastLoginTime from requests where id = 2 ')
NULL を返します。理由はわかりますか??
mysql> SELECT TIMESTAMPDIFF(SECOND, NOW(), 'select last_update from t1 where actor_id = 2 ');
+--------------------------------------------------------------------------------+
| TIMESTAMPDIFF(SECOND, NOW(), 'select last_update from t1 where actor_id = 2 ') |
+--------------------------------------------------------------------------------+
| NULL |
+--------------------------------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
' を削除して () を追加
mysql> SELECT TIMESTAMPDIFF(SECOND, NOW(), (select last_update from t1 where actor_id = 2));
+-------------------------------------------------------------------------------+
| TIMESTAMPDIFF(SECOND, NOW(), (select last_update from t1 where actor_id = 2)) |
+-------------------------------------------------------------------------------+
| -199167725 |
+-------------------------------------------------------------------------------+
1 row in set (0.00 sec)