PostgreSQL - Set Operations and Advanced Queries
You want to insert a new user with
email and last_login into a table users(email TEXT UNIQUE, last_login TIMESTAMP). If the email already exists, update last_login only if the new timestamp is more recent. Which query correctly implements this conditional update?