We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Edits: Updated with the sql_mode='' based on @jakab922's comment. HackerRank changed the default sql_mode behavior to only_full_group_by at some point after I posted this.
Also, a full solution without the need to change modes was posted by @dougal_michael below, which uses the MIN() function instead.
SQL Project Planning
You are viewing a single comment's thread. Return to all comments →
A simple MySQL implementation without variables and only requiring DATEDIFF():
Edits: Updated with the sql_mode='' based on @jakab922's comment. HackerRank changed the default sql_mode behavior to only_full_group_by at some point after I posted this.
Also, a full solution without the need to change modes was posted by @dougal_michael below, which uses the MIN() function instead.