DEV Community

Discussion on: SQL Practice Problem to Help You Pass Your Interview

Collapse
 
abdisalan_js profile image
Abdisalan

Very interesting! That works too!
I never thought to have another query in the where clause for comparison.

d.adopted_on >=
(
  select max(adopted_on) from dogs
  where d.owner_id = dogs.owner_id
)
Collapse
 
kamo profile image
KAIDI

Yeah, you can check the full syntax here
dev.mysql.com/doc/refman/8.0/en/se...