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 C4B459FA5BA for ; Wed, 28 Jun 2006 08:44:06 -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 46498-03 for ; Wed, 28 Jun 2006 08:43:56 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31806.mail.mud.yahoo.com (web31806.mail.mud.yahoo.com [68.142.207.69]) by postgresql.org (Postfix) with SMTP id 10F239F9DCC for ; Wed, 28 Jun 2006 08:43:56 -0300 (ADT) Received: (qmail 48695 invoked by uid 60001); 28 Jun 2006 11:43:55 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5eYcg1INnww3t5Uf51ZWR1nMonOwLLyMgIP8RZNR3Q2i2lbOkW+oAxwY7kovgeVSu86sSK7t9aVoEAL+TgiG6lC+lTFDmwLfOcm/KVELqaBIhOjzNK4A2y/lxiWc7Lbq2sc5fnnxL+KS3zQTKgqXB5JkFXXVGP/+Ro26gCdxsNc= ; Message-ID: <20060628114355.48693.qmail@web31806.mail.mud.yahoo.com> Received: from [24.54.196.198] by web31806.mail.mud.yahoo.com via HTTP; Wed, 28 Jun 2006 04:43:55 PDT Date: Wed, 28 Jun 2006 04:43:55 -0700 (PDT) From: Richard Broersma Jr Subject: Re: i need solution to this problem To: Ragnar , "Penchalaiah P." Cc: pgsql-sql@postgresql.org In-Reply-To: <1151480049.28621.29.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/294 X-Sequence-Number: 25530 > > 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? yes. in addition to this, it seems that emp_table references personal_table on personal_no = per_no. But it is not clear how this is the case when personal_no is an integer and per_no is a varchar. Regards, Richard Broersma Jr.