add batch remove batch split batch show hidden batches hide batch
db<>fiddle
feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version()
10.3.28-MariaDB
user_id last_login domain_name
abc@blah.ie 2021-03-06 00:00:00 blah.ie
bill@xyz.ie 2020-03-15 00:00:00 xyz.ie
fred@xyz.ie 2020-03-20 00:00:00 xyz.ie
joe@xyz.ie 2020-02-12 00:00:00 xyz.ie
mary@xyz.ie 2020-03-14 00:00:00 xyz.ie
mike@xyz.ie 2020-01-31 00:00:00 xyz.ie
pol@blah.ie 2021-03-06 00:00:00 blah.ie
pqr@blah.ie 2021-03-06 00:00:00 blah.ie
rst@blah.ie 2021-03-06 00:00:00 blah.ie
xyz@blah.ie 2021-03-06 00:00:00 blah.ie
domain_name last_login_by_domain
xyz.ie 2020-03-20 00:00:00
user_id substring_index(a.user_id, '@', -1) MAX(a.last_login)
mike@xyz.ie xyz.ie 2020-03-20 00:00:00