SELECT @account:= account, @dollars := dollars, @last_update := last_update FROM accounts WHERE account = 1; SELECT * FROM accounts WHERE last_update > @last_update OR (last_update = @last_update AND dollars < @dollars) OR (last_update = @last_update AND dollars = @dollars AND account > @account) ORDER BY last_update, dollars DESC, account LIMIT 1; You can replace the user variables with the appropriate subqueries if desired (e.g., replace @account with the literal 'BTblahblah', and @last_update with (SELECT last_update FROM accounts WHERE id = 'BTblahblah')