I am trying to return all value of the_id that have been received within the past 8 days and there is at least 1 duplicated name. This should return 1,5.
SELECT the_id, count(*) c FROM "MYTABLE" WHERE "received" < date('now','-8 days') GROUP BY the_name HAVING c > 1;
Aucun commentaire:
Enregistrer un commentaire