All pastes #746509 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-23 07:46 UTC
rendered paste body
          SELECT
            tmk3_trade.widet,
            tmk3_trade.context,
            tmk3_trade.price,
            tmk3_trade.time,
            MAX(tmk3_trade.time)
          FROM
            tmk3_trade
          WHERE
            tmk3_trade.station = 15221
          GROUP BY
            tmk3_trade_widget
          ORDER BY
            tmk3_trade.context,
            tmk3_trade.price
          ;

+---------+---------------------------+------+-----+-------------------+----------------+
| Field   | Type                      | Null | Key | Default           | Extra          |
+---------+---------------------------+------+-----+-------------------+----------------+
| id      | int(11)                   | NO   | PRI | NULL              | auto_increment |
| widget  | int(11)                   | NO   |     | 0                 |                |
| station | int(11)                   | NO   |     | 0                 |                |
| context | enum('buy','sell','want') | NO   |     | buy               |                |
| user    | int(11)                   | NO   |     | 0                 |                |
| time    | timestamp                 | NO   |     | CURRENT_TIMESTAMP |                |
| price   | int(11)                   | NO   |     | 0                 |                |
+---------+---------------------------+------+-----+-------------------+----------------+