I have a table with columns account_id
and creation_date
. The creation_date
gets the current timestamp when the account is created (row is inserted) - how can I get the oldest account to return? In other words, the row which has the earliest timestamp in the table?
I've tried SELECT account_id, MIN(creation_date) FROM table
but can't seem to get MIN()
to work how I'd like it to.
Looks like this was the way to do it:
SELECT account_id, creation_date FROM table WHERE creation_date = (SELECT MIN(creation_date) FROM table)