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 836629FA501 for ; Thu, 29 Jun 2006 12:30:48 -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 07610-06 for ; Thu, 29 Jun 2006 12:30:41 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by postgresql.org (Postfix) with ESMTP id 106E09FA081 for ; Thu, 29 Jun 2006 12:30:40 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id a2so394631ugf for ; Thu, 29 Jun 2006 08:30:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=c4UKJpPqfWMrl7PRH1caWo3x1HPLlMXKP3XI6jwE2QVpUCfWmCsSzzRIHp6nx4DhCRaYL/0BjxKewdyPHPB7JDsFIqD83xi/In0nIbM8uJN4iYouVm3JXZo15D+Z/kvu6zm0SYwnk92lRGbcICpOuY6ruq7dXhdaabc3/hzoCvo= Received: by 10.78.165.16 with SMTP id n16mr1020112hue; Thu, 29 Jun 2006 08:30:39 -0700 (PDT) Received: by 10.78.29.2 with HTTP; Thu, 29 Jun 2006 08:30:39 -0700 (PDT) Message-ID: Date: Thu, 29 Jun 2006 10:30:39 -0500 From: "Aaron Bono" To: "Penchalaiah P." Subject: Re: can any one solve this problem Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21724_26915223.1151595039323" References: X-Google-Sender-Auth: abefef5cec7c4b56 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/316 X-Sequence-Number: 25552 ------=_Part_21724_26915223.1151595039323 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I suggest you give a first stab at it and show us what you are doing. That would help us see your table relationships better (please use inner/outer joins to make it clearer) and get a better idea of what you are trying to do. Also, providing data examples like some of the other posts really help us help you get a good solution. -Aaron On 6/29/06, Penchalaiah P. wrote: > > emp_table( > > Cdacno varchar (7) (primary key), > > Personal_No varchar (10)(foreign key), > > Name varchar (40)); > > > > personal_table ( > > Personal_No varchar (10) (primary key), > > Cdacno varchar (7), > > Date_Of_Birth date); > > > > unit_master ( > > Unit id varchar (10) (primary key), > > Unit_Name varchar(25), > > Unit_Location varchar(25)); > > > > Unit_Details_table ( > > Unit_id varchar (foreign key) > > CDA_No varchar(7) foreign key); > > > > rank_table( > > Rank_ID numeric(2)(primary key), > > Rank_Code numeric(2), > > Rank_Name varchar (25)); > > > > Rank_Date_table ( > > Rank_Date__ID numeric NOT NULL, > > CDA_No varchar(7) (foreign key), > > Rank_ID numeric(2)); > > > > My query is =85.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_tabl= e, > unit_name from unit_master.. > > > > Like that if I give per_no I have to get cdacno from emp_table.. .. With > this I have to display rank_name from rank_table ,name from emp_table, > unit_name from unit_master.. > > > > And here unit_name is depends on unit_details_table ..and rank_name is > depends on rank_date_table.. > > > > Doing these things first it has to check when we r giving cdacno.. whethe= r > per_no is null or not.. like this if I give per_no it has to check cdacn= o > is null or not. > > > > Let me know the solution.. > > But I written one function to this to get per_no if I give cdacno=85=85= =85=85=85=85=85. > ------=_Part_21724_26915223.1151595039323 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I suggest you give a first stab at it and show us what you are doing. = That would help us see your table relationships better (please use inner/o= uter joins to make it clearer) and get a better idea of what you are trying= to do.

Also, providing data examples like some of the other posts really h= elp us help you get a good solution.

-Aaron

On 6/29/06, Penchalaiah P. <penchalaiahp@infics.com= > wrote:

emp_table(

Cdacno varchar (7) (primary key)= ,

Personal_No varchar (10)(foreign= key),

Name varchar (40));

 

personal_table (

Personal_No varchar (10) (primar= y key),

Cdacno varchar (7),

Date_Of_Birth date);

 

unit_master (

Unit id varchar (10) (primary ke= y),

Unit_Name varchar(25),

Unit_Location varchar(25));

 

Unit_Details_table (

 Unit_id varchar (foreign k= ey)

CDA_No varchar(7) foreign key);<= /span>

 

rank_table(

Rank_ID numeric(2)(primary key),=

Rank_Code numeric(2),

Rank_Name varchar (25));<= /font>

 

Rank_Date_table (

  Rank_Date__ID numeric NOT NULL,

  CDA_No varchar(7) (foreig= n key),

  Rank_ID numeric(2));

 

My query is =85.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..

 

Like that if I give per_no I have to get cdacno from emp_table.. .. With this I have to display rank_name from rank_table ,name = from emp_table, unit_name from unit_master..

 

And here unit_name is depends on unit_details_table ..and rank_name is depends on rank_date_table..

 

Doing these things first it has to check when we r giving cdacno.. whether  per_no is null or not.. like this if I give per_no i= t has to check cdacno is null or not.

 

Let me know the solution..

But I written one function to this to get per_no if I give cdacno=85=85=85=85=85=85=85.


 

------=_Part_21724_26915223.1151595039323--