>> >> thetradinghall=> SELECT u.username ||'@'||d.domain as email_address >> FROM email.mailusers u >> INNER JOIN >> email.domainlist d >> ON >> (u.domain_id=d.id); >> >> email_address >> ----------------------------------- >> arnaud.gaboury@xxxxxxxxxxxxxxxxxx >> (1 row) >> ------------------------------------- >> >> As for the cleaning of ID, I dropped id and changed both primary keys. >> Thank you so much for your prompt answer and help. In fact I kept the id for table domainlist (changed the name accordingly your advise). If I remove the id column, I will not be able anymore to do the above SELECT , no? The condition (u.domain_id=d.id) will no more be possible. Am I wrong? > > You're very welcome - glad to be able to help. > > R. > > > -- > Raymond O'Donnell :: Galway :: Ireland > rod@xxxxxx -- google.com/+arnaudgabourygabx -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general