X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AC6259DC83F for ; Tue, 14 Feb 2006 11:28:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49148-02 for ; Tue, 14 Feb 2006 11:28:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 4DC489DC804 for ; Tue, 14 Feb 2006 11:28:33 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 383D63093C; Tue, 14 Feb 2006 16:28:38 +0100 (MET) From: "garhone" X-Newsgroups: pgsql.sql Subject: SELECT on a to-be-determined table Date: 14 Feb 2006 07:28:30 -0800 Organization: http://groups.google.com Lines: 43 Message-ID: <1139930910.624290.83370@g44g2000cwa.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 cerberus.consumercontact.com:8080 (squid/2.5.STABLE1) Complaints-To: groups-abuse@google.com Injection-Info: g44g2000cwa.googlegroups.com; posting-host=209.167.202.14; posting-account=xbiNWA0AAAATcpeB_WPmKiETyj6063eZ To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200602/228 X-Sequence-Number: 24238 Hi, I'm a new at this. So please forgive if I mess up. Also, if there is already a reference/tutorial somewhere, feel free to point me to it. Here's my situation: db=# select * from projects; projid | projname --------+---------- 1 | cars 2 | houses 3 | pets (3 rows) db=# select * from cars; carid | carname -------+--------- 1 | ford 2 | mazda (2 rows) db=# select * from houses; houseid | housename ---------+----------- 1 | semi 2 | trailer 3 | mansion (3 rows) db=# select * from pets; petid | petname -------+--------- 1 | dog 2 | cat 3 | bird (3 rows) Is it possible to do this: Give me all the rows of the table whose project id is 2 (or whatever projid). Thanks