All pastes #2117065 Raw Edit

Untitled

public text v1 · immutable
#2117065 ·published 2012-02-10 21:41 UTC
rendered paste body
mysql> describe trade_history;
+-----------+----------+------+-----+---------+----------------+
| Field     | Type     | Null | Key | Default | Extra          |
+-----------+----------+------+-----+---------+----------------+
| pid       | int(11)  | NO   | PRI | NULL    | auto_increment |
| companyid | int(11)  | NO   |     | NULL    |                |
| value     | int(11)  | NO   |     | NULL    |                |
| ts        | datetime | NO   |     | NULL    |                |
+-----------+----------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

mysql> select * from trade_history;
+-----+-----------+-------+---------------------+
| pid | companyid | value | ts                  |
+-----+-----------+-------+---------------------+
|   1 |         1 |   367 | 0000-00-00 00:00:01 |
|   2 |         1 |   432 | 0000-11-00 00:00:00 |
|   3 |         1 |   553 | 0000-00-00 00:00:11 |
+-----+-----------+-------+---------------------+
3 rows in set (0.00 sec)

mysql> select max(ts) from trade_history;
+---------+
| max(ts) |
+---------+
| NULL    |
+---------+
1 row in set (0.00 sec)

mysql>