Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C6DC31A97FA1 for ; Sat, 14 Jan 2012 05:42:58 -0400 (AST) Received: from news.hub.org ([200.46.204.72]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rm08W-0007Lq-OO for pgsql-sql@postgresql.org; Sat, 14 Jan 2012 09:42:59 +0000 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 q0E9gcwO091404 for ; Sat, 14 Jan 2012 05:42:38 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id q0E9Jrga076393 for pgsql-sql@postgresql.org; Sat, 14 Jan 2012 05:19:53 -0400 (AST) (envelope-from news) From: Alok Thakur X-Newsgroups: pgsql.sql Subject: sql query problem Date: Sat, 14 Jan 2012 01:18:17 -0800 (PST) Organization: http://groups.google.com Lines: 13 Message-ID: <5ec02ff4-d24b-4824-8116-5445262a6a61@lr19g2000pbb.googlegroups.com> 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: lr19g2000pbb.googlegroups.com; posting-host=122.162.150.14; posting-account=SfA6UQoAAABK2sFf3BziLnaTFwz9F0Hc User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe) To: pgsql-sql@postgresql.org X-Pg-Spam-Score: 0.9 (/) X-Archive-Number: 201201/62 X-Sequence-Number: 36233 Dear All, I have two tables one contains details of user and other contains result. The details are: 1. UserTable - id, name, phone 2. result - id, question_id, user_id, status (0 or 1) I want the list like this: User Id Name Attended Failed Passed but i could not find the way to do this. Please help