X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C74F89FA5F0 for ; Wed, 28 Jun 2006 04:33:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 05017-08 for ; Wed, 28 Jun 2006 04:33:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx1.ipf.is (benz.ipf.is [85.197.192.156]) by postgresql.org (Postfix) with ESMTP id 11BF59FA2F0 for ; Wed, 28 Jun 2006 04:33:14 -0300 (ADT) Received: (qmail 8188 invoked by uid 1010); 28 Jun 2006 07:26:57 +0000 Received: from 85.197.216.186 by benz (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88/1235. spamassassin: 3.1.1. perlscan: 1.25-st-qms. Clear:RC:1(85.197.216.186):SA:0(-4.2/4.5):. Processed in 0.317901 secs); 28 Jun 2006 07:26:57 -0000 X-Antivirus-IPF-Mail-From: gnari@hive.is via benz X-Antivirus-IPF: 1.25-st-qms (Clear:RC:1(85.197.216.186):SA:0(-4.2/4.5):. Processed in 0.317901 secs Process 8181) Received: from dsl-216-186.hive.is (HELO ?192.168.1.33?) (85.197.216.186) by mx1.ipf.is with SMTP; 28 Jun 2006 07:26:57 +0000 Subject: Re: i need solution to this problem From: Ragnar To: "Penchalaiah P." Cc: pgsql-sql@postgresql.org In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Date: Wed, 28 Jun 2006 07:34:09 +0000 Message-Id: <1151480049.28621.29.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/293 X-Sequence-Number: 25529 On mið, 2006-06-28 at 11:15 +0530, Penchalaiah P. wrote: > I have tables like 1) emp_table (personal_no integer (foreign key), > cdacno varchar (primary key),name varchar); > 2) Rank_table (rank_id varchar (primary key), rank_name varchar); > 3) Rank_date_table (rank_id (foreign key), rank_date date); > 4) Unit_table (unit_id varchar (primarykey), unit_name varchar); > 5) Personal_table (per_no varchar (primary key), pername varchar); > My query is ….if I give cdacno I have to get per_no from > personal_table.. With this I have to display rank_name from > rank_table ,name from emp_table, unit_name from unit_master.. it is not clear what the relationships are between the tables. for example what is the foreign key to unit_table? how does the rank connect to emp_table or personal_table? gnari >