Thanks! But, since the master can contain many users (user2, user3, and so on) I suppose this won't be a proper solution? Sorry if I was a bit unclear in my description. I.e., the master is of the form: user_id date User1 20010101 User1 20000101 User1 19990101 User1 19970101 User2 ... ... Btw, I'm using Postgre version 8.2 and I cannot use subqueries do the GP software. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general