On Sat, 2009-12-19 at 20:36 +0000, Garry Saddington wrote: > Anyone have any ideas/suggestions on how to model siblings in a database > so that it is possible to eg. only send letters to the parents once. In > this scenario each sibling has the contact parents input separately > (secretarial input!). It's best to always iron out a specific organizational policy before trying to model it as a database. Think carefully about a policy that works with paper, and often that makes the database model obvious. If there are already governmental policies regarding the notices, they probably already tell you exactly when you can eliminate duplicate notices. How will you tell that the parents are the same? By name and address? Just address? Siblings? What about half-siblings and other complicating situations? The query you want to use is pretty simple, and might go something like: SELECT DISTINCT address FROM student WHERE ... But it all depends on what the policy actually is. And if the notice is something simple, such as announcing a fund-raiser, then you should keep it simple and just send one to each distinct address in the database. Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general