Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4E11C1337B5E for ; Wed, 5 Jan 2011 10:25:13 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 46149-05 for ; Wed, 5 Jan 2011 14:25:06 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id E3E2C1337B5C for ; Wed, 5 Jan 2011 10:25:05 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id p05EP501065007 for ; Wed, 5 Jan 2011 10:25:05 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id p05EIQt8052373 for pgsql-sql@postgresql.org; Wed, 5 Jan 2011 10:18:26 -0400 (AST) (envelope-from news) From: Tarsis Lima X-Newsgroups: pgsql.sql Subject: return records with more than one occurrences Date: Wed, 5 Jan 2011 06:18:26 -0800 (PST) Organization: http://groups.google.com Lines: 18 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Complaints-To: groups-abuse@google.com Complaints-To: groups-abuse@google.com Injection-Info: c2g2000yqc.googlegroups.com; posting-host=201.50.120.5; posting-account=LjR1qQoAAACZE2WTqQ4BR8bzpApv56Br User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/532.5, gzip(gfe) To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-5 required=5 tests=BAYES_20=-0.001, FREEMAIL_FROM=0.001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201101/12 X-Sequence-Number: 34959 how would the SELECT to return only records with more than one occurrences of id_table1? example: -- Table1 -- id -- ------------------------- 1 2 -- Table2 id --- | id_table1 | name ---------------------------------------------- 4 ---- | ----- 1 ------ | Tom 5 ---- | ----- 1 ------ | Luci 6 ---- | ----- 2 ------ | Cleber ------>this can not return