I have a Google Big Query Table that has an email
column in it. Basically each rows shows a state the user with that email address existed in. What I want to do is query the table to get a result showing the most recent row per email address. I've tried all sorts of GROUP BY
's, JOIN
ing the table against itself and the usual fun stuff that I would use in MySQL, but I keep getting duplicate emails returned if the entire row isn't a match.
Any help is much appreciated!
Sample Data
user_email | user_first_name | user_last_name | time | is_deleted
test@test.com | Joe | John | 123456790 | 1
test@test.com | Joe | John | 123456789 | 0
test2@test.com | Jill | John | 123456789 | 0
So if sampling that data I would want to return:
user_email | user_first_name | user_last_name | time | is_deleted
test@test.com | Joe | John | 123456790 | 1
test2@test.com | Jill | John | 123456789 | 0