Which is more optimised making DISTINCT query in MySQL to get unique results or generate a set?
I am trying to fetch unique aocDetailIds in spring boot should I use distinct keyword(Code Block 1) or should I create a SET of strings(Code Block 2) , which will be more optimised ? @Query(value = "SELECT DISTINCT a.aocDetailId FROM…