in reply to MySql Timestamps

If the entry and exit timestamps are in different rows, then you simply need to do a self-join to get both. Something like:
select time_diff(t1.timestamp, t2.timestamp) from the_table t1, the_table t2 where t1.customer_id = t2.customer_id and ... other conditions ....
Note that I'm not sure if MySQL supports this form of joins, or if you need to use ANSI joins.

Michael

Replies are listed 'Best First'.
Re^2: MySql Timestamps
by dragonchild (Archbishop) on Jul 06, 2004 at 18:16 UTC
    Yes, MySQL 4.x and higher supports self-joins. I'm not sure about 3.x.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested