Re: SQL Sort by date >Thanks for all the replies.. sadly I'm at home and can't try these out,
>but at least these are some good starts if not solutions. I came up
>with something that appears to work doing:
>
>SELECT * FROM mytable
>GROUP BY order_id
>ORDER BY TIMESTAMP
>
>Which gives the current status of all orders (I think). However, I
>still have to filter in code for the status. Not terribly elegent.
If you have multiple records for a given order_id, with different
values of status, you get ONE value of status returned. It is
not necessarily the first status, or the last status, or the status
associated with the timestamp returned.
Gordon L. Burditt |